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.

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.

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.

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

#include<stdio.h> #include<math.h> #define pf printf int main() { int a; float i,res=0.0,temp; //taking the number to continue loop pf("Enter any number: "); scanf("%d",&a); for(i=1.0;i<=a;i++) { float temp=0.0; temp=i/(i+1); //calculating as given in the series and assigning temp res+=temp; //value of the temp is adding with res variable } pf("\nThe summation of the series is: %f",res); return 0; }

Enter any number: 10

The summation of the series is: 7.980123

The summation of the series is: 7.980123

- Print first N natural number
- Print N natural number in a given range ( ascending way )
- Bonus on employment salary
- Print even or odd number
- Average of given input
- 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
- Print all ASCII value
- Calculate Summation of this series 1 + 2
^{2}/2 + 3^{2}/3 + ...... + x^{2}/x - Print 1 3 6 10 15 21 ........ this series

© 2018 - All rights reserved