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.

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.

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

#include<stdio.h> #include<math.h> #define pf printf int main() { int n,m,j,sum=0; float ave; //taking the number to continue loop pf("Enter any integer number: "); scanf("%d",&n); for(j=1;j<=n;j++) { pf("\nEnter the number %d => ",j); //taking input scanf("%d",&m); sum+=m; //every given input number is adding with sum } ave=(float)sum/n; //sum is typecast to float pf("\nThe average of given number is : %f",ave); return 0; }

Enter any integer number: 3

Enter the number 1 => 1

Enter the number 2 => 2

Enter the number 3 => 3

The average of given number is : 2.000000

Enter the number 1 => 1

Enter the number 2 => 2

Enter the number 3 => 3

The average of given number is : 2.000000

- Bonus on employment salary
- Print even or odd number
- Leap year
- Print whether given number is prime or composite
- Prime number in a range
- Leap year in a range
- Print a multiplication table of Nth number
- Print even and odd number in a range
- 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}

© 2018 - All rights reserved