APC-S-007.c (568B)
1 /* Write a program the sum of first 10 natural numbers. */ 2 3 /* 4 * Compiler Note: This source code is specifically designed for compilation 5 * and execution within the ** Turbo C ** environment. 6 * 7 * Testing Disclaimer: Due to a lack of access to the required Turbo C 8 * compiler software, this code has not been formally compiled or tested. 9 */ 10 11 #include <stdio.h> 12 #include <conio.h> 13 14 void main() 15 { 16 clrscr(); 17 int i, sum = 0; 18 for (i = 1; i <= 10; i++) 19 { 20 sum += i; 21 } 22 printf("\nSum of the first natural number : %d", sum); 23 getch(); 24 }