Operator In C Programming language
In this post, We will learn about the basic operator that are available in C programming language. In C programming language an operator helps us in doing computation like adding numbers or variables value, other mathematical mutation and other computations.
Example Arithmetic operator
In this post, We will learn about the basic operator that are available in C programming language. In C programming language an operator helps us in doing computation like adding numbers or variables value, other mathematical mutation and other computations.
Type Of 0perator In C Program
C programming language has mainly the following types of operators are available
- Arithmetic Operator
- Assignment Operator
- Relational Operator
- Logical Operator
- Ternary Operator
- Bitwise Operator
- Comma Operator
Arithmetic Operator in C Programming
In C Programming language, An arithmetic operator performs mathematical operations such as addition, subtraction and multiplication on numerical values.
| Operator | Meaning of Operator |
|---|---|
| + | addition or unary plus |
| - | subtraction or unary minus |
| * | multiplication |
| / | division |
| % | remainder after division( modulo division) |
Example Arithmetic operator
#include <stdio.h>
int main()
{
int a = 9,b = 4, c;
c = a+b;
printf("a+b = %d \n",c);
c = a-b;
printf("a-b = %d \n",c);
c = a*b;
printf("a*b = %d \n",c);
c=a/b;
printf("a/b = %d \n",c);
c=a%b;
printf("Remainder when a divided by b = %d \n",c);
return 0;
}
Assignment Operator In C Programming
Coming soon...
Comments
Post a Comment