Posts

Showing posts from June, 2021

Logical Operator and conditional operator

Image
Logical Operator  The logical operators are the symbols that are used to combined multiple condition into one condition.   Logical Operator with example Operator Meaning Example && Logical AND -Return TRUE   if all conditions are TRUE otherwise returns FALSE 8<5&&12>10 is FALSE || Logical OR- Returns FALSE if all condition are FALSE otherwise returns TRUE 8<5&&12>10 is true ! Logical NOT -Return TRUE if condition is FALSE and returns FALSE if it is TRUE !(8<5   && a2>10) is true Conditional operator  The conditional operator is also called a ternary operator  because it requires three operands. This operator is used for decision making. Syntax Condition? TRUE part :FALSE part; Example-write a code for conditional operator  program- #include...

Arithmetic and Relational Operators with example in C programming

Image
 Arithmetic (+,-,/,%) Arithmetic Operators in C The arithmetic operators are the symbols that are used to perform basic mathematical  operations like addition , subtraction, multiplication, division and percentage modulo. Example-Write a program to perform all Arithmetic operation in c language  Program for Arithmetic operation #include <stdio.h> void main() {   int a, b;             printf("Enter the valur of the two number for performing the arithmatic opertion \n");       printf("Enter the frist number a::");       scanf("%d",&a);       printf("Enter the second number of the b::");       scanf("%d",&b);     printf("Arithmetic operator in C \n");  printf("this is value of a+b is %d",a+b); printf("\nthis is value of a-b is %d",a-b); printf("\n this is value of a*b is %d",a*b);     printf("\n This is value of a/b is %d",a/b); }...

Constants in C Programing with Example

Image
 Constants: A constant is analogous to the variable but the constant hold just one value during the program execution. In constant once a value is assigned to the constant, that value cannot be changed during the program execution. Once value is assigned to the constant, it is fixed throughout the program. In C programming language, a constant are often of any data type like integer, floating-point, character, string and double ,etc. Creating constants in C Constant  can be created using two concepts. Using the 'const' keyword- We create a constant of any data type using 'const' keyword. To create a constant , we prefix the variable declaration with 'const' keyword. Syntax const datatype constantName;                         or  const datatype constantName=value; Example: const int c=10; Here 'x' is a integer constant with fixed value 10.   Q.N. write code for const and try to change value of con...

Assigning values to variables in C Programming

Image
 Variable  Variables in C Variables in c programming language are the named memory location . A variable are often defined as a storage container to carry values of an equivalent data type during the program execution. Every variable must have a data type that determines the range and sort of values be stored. The subsequent are the principals to specify a variable name:  1.Variable name should not start with a digit   2. Keyword should not be used as variable names.  3.A variable name should not contain any symbols except underscore(_).  4.A variable name can be of any length but compiler considers only the first 31 characters of the variable name. Declaration of Variable  Declaration of variable tells the compiler to allocate the required amount of memory with the specified variable name and allows only specified data type values into that memory location. Declaration Syntax:                    ...

C language with code

Image
  C language                Background C is a general- purpose programming language. In the early 1970s the C programing language was designed and enforced by  Dennis Ritchie     at Bell Laboratores on a DEC PDP  that used the UNIX operating system, Scope C language  C Programming Language is very fashionable computer programming language through which users and computers can communicate .Anyone can learn C Programming Language from the basics. Every topic in this blog is explained with clear information and good examples. Q.N,- Using the c language print the "hello!". code:  #include<stdio.h> void main() { printf("hello!"); //printf  is name of main  C  output funtions } output- hello! -------------------------------- Character Set  in c language  As every language contains a group of characters used to construct words, statements etc. c language supports a total of 256 char...