Write a program in C to find the sum of first 10 Natural Numbers. 😊😊😊😊

                                                         Vs Code


#include <stdio.h>

int main()

{

int c, t = 0;

for (c = 0; c < 10; c++)

{
t = t + c;
}
printf("The sum of ten natural number is : %d\n", t);

    return 0;
}



                                                          Turbo C++


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

int main()

{

int c, t = 0;
    clrsce();

for (c = 0; c < 10; c++)

{
t = t + c;
}
printf("The sum of ten natural number is : %d\n", t);
    
    getch();
    
    return 0;
}

Post a Comment

0 Comments