The test expression done on exact statement. The good habit of using test expression on exact or fulfill statement. So do not use floating point numbers for checking for equality in the test expression.
Semoclone ( ; ) is one of the best sensitive symbols in programming. Placing a semicolon ( ; ) after the WHILE or FOR loop is not a syntax error. So it will not be reported by the compiler. However, it is considered to be a logical error as it change
The iterative statement is one of the most important and interesting statements in the programming world. An iterative statement is used to repeat the execution of a list of statements, depending on the value of an integer expression.
Missing the inclusion of appropriate header file in c program will generate an error. Such a program may compile but the linker will given an error message as it will not be able to find the functions used in the program.
Specifier is a typedef-name and a very sensitive in C programming. Using an incorrect specifier for the data type being read or written will generate a run time error.
// AHF C PROGRAM SOLVING //solving here basic type of programming problemOUTPUT:
#include<stdio.h> #include<math.h> #define pf printf int main() { double radius,a,b,height,width,res1=0.0,res2=0.0,res3=0.0; //area for circle pf("\nEnter value for circle.............."); pf("\nEnter the radius of the circle: "); scanf("%lf",&radius); res1=3.1416*radius*radius; //area for triangle pf("\nEnter value for triangle.............."); pf("\nEnter the first length: "); scanf("%lf",&a); pf("\nEnter the second length: "); scanf("%lf",&b); res2=.5*a*b; //area for rectangle pf("\nEnter value for rectangle.............."); pf("\nEnter the height: "); scanf("%lf",&height); pf("\nEnter the width: "); scanf("%lf",&width); res3=height*width; //total output pf("\nThe area of the circle is : %lf",res1); pf("\nThe area of the triangle is = %lf",res2); pf("\nThe area of the rectangle is = %lf",res3); return 0; }