Calculate First 10 Integer Numbers Sum Using Loops

 


Answer:

#include<stdio.h>
int main()
{   int n=10,sum=0,i=1;
    while(i<=n){
        sum += i ;
        ++i;
    }
    printf("%d"sum);
    
    return 0;
}

Now just submit the code and check the result.

Comments

Popular posts from this blog

C program to find the greatest of three numbers with user input.

Access denied in VS code for gcc while doing C programming

How to add to integers in C programming