#include void main() { int a=8, b=2, x=8, y=2, sum1, sum2; /* Increment then add */ sum1=a+(++b); /* Add then increment */ sum2=x+(y++); printf(“\nSUM1=%d”,sum1); printf(“\nSUM2=%d”,sum2); } run SUM1=11 SUM2=10
Author: Pawan Paudel
write a c program to print the Area of a circle?
#define PI 3.14 #include void main() { float r=5.25; float area; area = PI*r*r; printf(“\n Area of a circle = %f”, area); } Compile: Area of a circle = 86.546249 ——————————– Process exited after 0.04764 seconds with return value 30 Press any key to continue . . .
Conditional Operator In C Language with Example (?:)
The conditional operators in C language are known by two more names Ternary Operator ?: Operator It is actually the if condition that we use in C language decision making, but using conditional operator, we turn the if condition statement into a short and simple operator. The syntax of a conditional operator is : expression […]
Example of Increment or Decrement Operator in C Language
Increment and decrement operators in C C language contains two unary operators referred to as increment (++) and decrement (–) operators. The two unary arithmetic operators in C Increment operator (++) Decrement operator (- -) The increment operator increments the variable by one and the decrement operator decrements the variable by one. These operators can […]