When you are using SWITCH case, it is important to keep in mind that the inclusion of DEFAULT LABEL. This will inform you whether you are executing your program in right or wrong way. So, it is always recommended to use DEFAULT LABEL in the SWITCH st

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.

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.

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

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 n,temp,sum_of_digits=0,rev=0; int positive=0,negative=0,zero=0,total; pf("\nEnter any number: "); scanf("%d",&n); while(n!=0) { temp=n%10; rev=rev*10+temp; //pf("\n%d",temp); sum_of_digits+=temp; { if(temp%2==0) pf("\n%d is even number.",temp); else pf("\n%d is odd number.",temp); } { if(temp>0) positive++; else if(temp<0) negative++; else zero++; } total=positive+negative+zero; n/=10; } pf("\nThe reverse number of the integer is: %d",rev); pf("\nSUMMATION OF EVERY DIGITS= %d",sum_of_digits); pf("\ncount of digits in integer= %d",total); return 0; }

Enter any number: 1234

The reverse number of the integer is: 4321

SUMMATION OF EVERY DIGITS= 10

count of digits in integer= 4

4 is even number. 3 is odd number. 2 is even number. 1 is odd number.

The reverse number of the integer is: 4321

SUMMATION OF EVERY DIGITS= 10

count of digits in integer= 4

- Calculate area of a triangle
- Calculate area of a rectangle
- 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
- Temperature Conversion from Fahrenheit to Celsius to Kelvin and Vice versa

© 2018 - All rights reserved