C Programming operators
Welcome to c programming learning
Last post program output is -
4*8^0+5*8^1=44
Because it is octal number by placing 0 in front of number.
I hope you clear. If there is any doubt please comment...
Next topic of c programming is operators
Those are classified as follows
1. Arithmetic operators
2. Logical operators
3. Relational operators
4. Assignment operators
5. Bit wise operators
6. Incrementoperators
7. Decrement operators
1. Arithmetic operators:-
These are mainly used for doing arithmetic operations. That is addition, subtraction, multiplication , Division.
Signs are +,-,/,*
Ex:- a+b;
a-b;
a*b;
a/b; // it returns divisible value
Note:
a%b; // it returns remainder
2. Logical operators:-
These are used for logical operations like AND,OR,NOT,XOR...etc.
Signs are &&,||,!, .. etc
Ex:-a&&b
In this condition both non zero then only true otherwise false
a||b
In this condition one of two is non zero or true then true otherwise false
!a
In this , if a is 0 then it makes 1, If a is 1 then 0
3. Relational operators:-
These are used for making comparisons in taht condition. Signs are < ,>,<= ,>=
Ex:-
a>b;
a<b;
a<2;
a<=3;..
etc
4. Assignment operators:-
These are used for assign some values to the variables in c programming.
Sign is =.
Ex:- a=2;
a+=2;
5. Bit wise operators:-
These are used to make the operation in bit wise. In this the give number is divided into it's binary format then operation will done.
Signs are &,|,^ etc
Ex:-
a&b;
a|b;
6. Increment operators:-
This is one of the operator commonly use in programming. When we want to increase one value each time.sign is ++; That is as follows
Ex:-
a++;
This means a=a+1;
7. Decrement operators:-
If we want to decrement in each step by one only then this operator is apt for that. This sign is --. Double subtraction sign.
This is as follows example
Ex:-
a--;
This equal to a=a-1;
This is over all operators. Thank you for reading..
Next post will be on keywords...
Here I am giving one program please solve and comment the output below....
#include<studio.h>
int main()
{
printf("%c",~("b"*-1));
return 0;
}
Output :. ?????????
In next post I will give you output .....
Last post program output is -
4*8^0+5*8^1=44
Because it is octal number by placing 0 in front of number.
I hope you clear. If there is any doubt please comment...
Next topic of c programming is operators
Those are classified as follows
1. Arithmetic operators
2. Logical operators
3. Relational operators
4. Assignment operators
5. Bit wise operators
6. Incrementoperators
7. Decrement operators
1. Arithmetic operators:-
These are mainly used for doing arithmetic operations. That is addition, subtraction, multiplication , Division.
Signs are +,-,/,*
Ex:- a+b;
a-b;
a*b;
a/b; // it returns divisible value
Note:
a%b; // it returns remainder
2. Logical operators:-
These are used for logical operations like AND,OR,NOT,XOR...etc.
Signs are &&,||,!, .. etc
Ex:-a&&b
In this condition both non zero then only true otherwise false
a||b
In this condition one of two is non zero or true then true otherwise false
!a
In this , if a is 0 then it makes 1, If a is 1 then 0
3. Relational operators:-
These are used for making comparisons in taht condition. Signs are < ,>,<= ,>=
Ex:-
a>b;
a<b;
a<2;
a<=3;..
etc
4. Assignment operators:-
These are used for assign some values to the variables in c programming.
Sign is =.
Ex:- a=2;
a+=2;
5. Bit wise operators:-
These are used to make the operation in bit wise. In this the give number is divided into it's binary format then operation will done.
Signs are &,|,^ etc
Ex:-
a&b;
a|b;
6. Increment operators:-
This is one of the operator commonly use in programming. When we want to increase one value each time.sign is ++; That is as follows
Ex:-
a++;
This means a=a+1;
7. Decrement operators:-
If we want to decrement in each step by one only then this operator is apt for that. This sign is --. Double subtraction sign.
This is as follows example
Ex:-
a--;
This equal to a=a-1;
This is over all operators. Thank you for reading..
Next post will be on keywords...
Here I am giving one program please solve and comment the output below....
#include<studio.h>
int main()
{
printf("%c",~("b"*-1));
return 0;
}
Output :. ?????????
In next post I will give you output .....
Comments
Post a Comment