#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 . . .
C
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 […]
C Programming language
C Language 1) Define C-language. Ans: C-language is a structured programming language that divides the program into many functions. 2) When and who developed C-language? Ans: Dennis Ritchie at Bell telephone laboratory-developed C-language in 1972 AD. 3) Why is C called middle level language? Ans: C is called middle-level language because it combines elements of […]