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.

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

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 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.

// AHF C PROGRAM SOLVING //solving here ITERATIVES STATEMENTS type of programming problem

We can solve this problem in two ways:

The first way is below:

#include<stdio.h> #include<math.h> #define pf printf int main() { int n,temp; //taking the value to continue the loop pf("\nEnter any integer number: "); scanf("%d",&n); pf("\nThe reserve number is: "); while(n!=0) //ending condition of the loop { temp=n%10; pf("%d",temp); //printing revers number n/=10; //update loop } return 0; }

The second way is below:

#include<stdio.h> #include<math.h> #define pf printf int main() { int x,temp,r=0; //taking the value to continue the loop pf("Enter any integer number: "); scanf("%d",&x); pf("\nThe reveres of %d = ",x); while(x!=0) //ending condition of the loop { temp=x%10; r=r*10+temp; //revers the given number and reserved in r variable x/=10; //update loop } pf("%d",r); //printing revers number return 0; }

Enter any integer number: 12345

The reveres of 12345 = 54321

The reveres of 12345 = 54321

- Bonus on employment salary
- Print a multiplication table of Nth number
- Calculate power i.e., calculate x
^{n} - Calculate Summation of this series 1 + 1/2 + 1/3 + ...... + 1/x
- Calculate Summation of this series 1 + 1/5 + 1/9 + 1/13 + ...... + 1/x
- Calculate Summation of this series 1 + 2
^{2}+ 3^{3}+ ...... + x^{x} - Calculate Summation of this series 1 + 2
^{2}+ 3^{2}+ ...... + x^{2} - Print 20 horizontal symbol like ($)
- Print largest number among 10 numbers
- Count positive, negative and zero untill (-1) is encountered
- Print largest and smallest number untill (-1) is encountered
- Calculate sum and average untill (-1) is encountered
- Print even and odd number untill (-1) is encountered

© 2018 - All rights reserved