Introduction
Introduction
Introduction
Solving
• Example:
int width, height = 20;
char value = ‘F’;
float base;
width = 10;
base = 30.65;
• Link section:
Includes headers files. It provides
instructions to the compiler to link functions
from the system library.
Ex:- # include<stdio.h>
# include<conio.h>
• Definition section:
Defines all symbolic constants
Ex:- # define A 10.
• Here a and b are operands, assign values for a=14 and b=4 we
have the following results
a-b = 10
a+b = 18
a*b = 56
a/b = 3 (quotient)
a%b = 2 (remainder)
DR. MONISHA DEVI
Relational operators:
• Relational operators are used for comparing two quantities.
• An expression containing a relational operator is termed as a
relational expression.
• The value of a relational expression is either 1 or 0. It is 1 if the
relation is true and 0 if the relation is false.
• The logical operators && and || are used when we test more
than one condition and make decisions.
• != is a unary operator which tests one condition.
(a += b) can be written as (a = a + b)
If initially value stored in a is 5. Then (a += 6) = 11.
Eg: a = 5 > 2 ? 10 + 20 : 10 - 20
Here testCondition is 5 > 2 which is True, so Expression 1 which is 10 + 20
executes and the output is 30
DR. MONISHA DEVI
Bitwise operator:
• Bitwise operators are used for manipulation of data at bit level.
• Bitwise operators may not be applied to float or double.