C examples for Data Type:int
Sum 1 to N Numbers using for statement
#include <stdio.h> int main(){//from w w w .j a v a 2 s .c o m int counter = 100; unsigned long int sum = 0; for (int i = 1; i <= counter; i++) { sum = sum + i; } printf("Required sum is: %lu\n", sum); return(0); }