Operators in C
In the last lecture we have learned about the variables and datatypes.
in this chapter we are going to learn about the operators.
So lets start operators are classified in following types
Arithmetic Operators
these are used in vital times, arithmatic operators means mathematical operators.
I hope you have already know the uses of the above symbols
suppose you want to compare the operands by logical operators
for example
here is a program of addition
you will clearly see that we have used the arithmetic operator in this program.
\n is used for assigning the new line.
and // used for the comment section compiler will automitically ignore it.
Relational Operators
These relational operators are used between two operands.
for example we want to compare the numbers ie 3 and 4 and we will use in the code as
Here 3 is smaller than 4 and 4 is greator than 3. for this we have used the operator as < and >.
after the completing the action (pricess) it will print the true or false value in binary number. for true it will print 1 and for false it will print 0.
These are same like relational operators. logical operators works on truth or false value i.e. 0 or 1 respectively
bitwise operators
Bitwise Operators |
These are to convert the input in Binary form
Assignment Operators
At the begining you should know about the arithmetic operators. As you do more practice in the programming. You will get the perfect idea of remaining operators.
So today we can end the lecture now.
But you have a quiz for the day
quiz
write a program using arithmetic operators. print the following lines.
11*3=33
75+25=100
30-15=15
you can paste the code in the comment section
or
you can massage me on whatsapp
0 Comments