{ A destination to learn coding }

Display first 10 natural numbers


#include < stdio.h >
int main()
{
    int a=1,sum=0,i;
    printf("Displaying first 10 natural numbers\n");

    for(i=0;i < 10;i++)
    {
        printf("%d\t",a);
        sum+=a;
        a+=1;
    }

    printf("\nThe sum of the first 10 natural numbers is %d",sum);
    return 0;
}