C Coding Full Course Notes
C Coding Full Course Notes
OPERATORS
IN C:
konsa operation phle perform hoga
knsa baad mei hoga…….
Sbse upr vale ki high
precedence ,down jaane pr
precedence kam.
Sequence control: Jo 1 ke baad 1 chlti
hai
Decision control: If/Else
Loop control: for loop, while loop
Case control: cases hote hai isme
! means not.
Expression ko ulta krta hai.
Example 1:
(4>5) is true, but
!(4>5) is false.
Example 2:
1. A=b means value of b assigned to a or
a=4 means 4 has been assigned to a.
2. A+=b means a=a+b 9aisa tb hga jb left
hand side and right hand side same
variables honge.
3. A-=b means a=a-b;
4. A*=b means a=a*b;
5. a/=b means a=a/b;
6. a%=b means a=a%b;
% is module operator :
Example 1 : 6%2 is 3 bcoz 3 is remainder
Example 2: 5%5 is 0 bcoz 0 is remainder
Conditional statements:
Types:
1. If-else
2. Switch
Example:
Example:
Example 1:
Output:
Example 2:
Output:
Output:
Practise questions:
Answer :
Solving by ternary method:
Output:
Question 2:
Question 3:
answer:
answer is “x is equal to 1” bcoz “x=2”
means x belongs to a.
but there we have to write a==b.
question 4:
Answer:
1st :
Example:
increment operators:
i++ and ++I
i++ means first print value of I and then
increase.
++I means first increase value of I then
print value of i.
2. Decrement operators:
i- -and - -i
I - - means first print value of I then
decrease it.
-- I means first decrease value of I then
print value of i.
1.
2.
3.
In qn 3rd (*ptr)++
means *ptr=*ptr+1.
Answer
1:
Answer
2:
Answer
3: