C examples for Data Type:int
Calculating the 200th Triangular Number with the for statement.
#include <stdio.h> int main (void) { int n, triangularNumber; triangularNumber = 0;/*from ww w. j a v a 2 s . c o m*/ for (n = 1; n <= 200; n = n + 1) triangularNumber = triangularNumber + n; printf ("The 200th triangular number is %i\n", triangularNumber); return 0; }