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.

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

Not putting // before the start of single statement comment is a compiler error. Not putting the */ after the termination of block comment is a compiler error.

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.

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.

// AHF C PROGRAM SOLVING //solving here basic type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int x1,x2,x3,x4,y1,y2,y3,y4; float length,wigth,area; pf("Enter the first co-ordinates(x1,y1): "); scanf("%d %d",&x1,&y1); pf("Enter the second co-ordinates(x2,y2): "); scanf("%d %d",&x2,&y2); pf("Enter the third co-ordinates(x3,y3): "); scanf("%d %d",&x3,&y3); pf("Enter the fourth co-ordinates(x4,y4): "); scanf("%d %d",&x4,&y4); length=sqrt(pow((x1-x2),2)+pow((y1-y2),2)); length=sqrt(pow((x3-x4),2)+pow((y3-y4),2)); wigth=sqrt(pow((x1-x4),2)+pow((y1-y4),2)); wigth=sqrt(pow((x2-x3),2)+pow((y2-y3),2)); area=length*wigth; pf("\n\nLENGTH= %.2f",length); pf("\nWIGTH= %.2f",wigth); pf("\n\nTHE AREA OF THE TRY-ANGLE= %.2f",area); return 0; }

Enter the first co-ordinates(x1,y1): 1 2

Enter the second co-ordinates(x2,y2): 2 3

Enter the third co-ordinates(x3,y3): 4 5

Enter the fourth co-ordinates(x4,y4): 5 6

LENGTH= 1.41

WIGTH= 2.83

THE AREA OF THE TRY-ANGLE= 4.00

Enter the second co-ordinates(x2,y2): 2 3

Enter the third co-ordinates(x3,y3): 4 5

Enter the fourth co-ordinates(x4,y4): 5 6

LENGTH= 1.41

WIGTH= 2.83

THE AREA OF THE TRY-ANGLE= 4.00

- Calculate area of a rectangle, triangle and circle
- Bonus on employment salary
- Print even or odd number
- Leap year
- Input any key from key-board and display key's feature
- Find large number of two or three given numbers
- Print ASCII value of a character and number
- Print all ASCII value
- Print vowel or consonant
- Find is the given number positive, negative and zero
- Summation, Subtraction, Multiplication and division
- Distance between two point
- Swap two numbers

© 2018 - All rights reserved