Skip to content

apc-s-007.c

Problem Statement

Write a program the sum of first 10 natural numbers.

Metadata

Property Detail
Author Amit Dutta (amitdutta4255@gmail.com)
License MIT

Actions

Raw View on GitHub

💡 You can print or save this file by opening Raw and using your browser.

Source Code

#include <stdio.h>
#include <conio.h>

void main()
{
    clrscr();
    int i, sum = 0;
    for (i = 1; i <= 10; i++)
    {
        sum += i;
    }
    printf("\nSum of the first natural number : %d", sum);
    getch();
}