C- Program to sum all integers from 100 down to 1.

Example : Program to sum all integers from 100 down to 1.

#include <stdio.h>

void main()

{

int sum = 0, i = 100 ;

while ( i )

sum += i– ;// note the use of postfix decrement operator!

printf( “Sum is %d \n”, sum ) ;

}

error: Content is protected !!