Arithmetic operations are addition, subtraction, multiplication ,division and modulus. All these operations can be performed in the C programming using arithmetic operators. Arithmetic operators are ( + , - , * , / ,%).Using these operators we can perform different types of operations. Program To add two numbers. #include <stdio.h> int main() { int a,b,c; printf("Enter the value of a :"); scanf("%d",&a); printf("Enter the value of b :"); scanf("%d",&b); c=a+b; printf("Addition of a and b is %d.",c); return 0; } Output : Enter the value of a :5 Enter the value of b :2 Addition of a and b is 7. In these program the first line "#include <stdio.h>" is the header file which is used for basic input and output in the program."int main()" here ...
Do your Programming with ease with codeeit.
Comments
Post a Comment