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.

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

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.

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.

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

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

Enter any number number: 45

5 is odd number.

4 is even number.

5 is odd number.

4 is even number.

- 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