Sum of first10 natural numbers || do while loop || C Programming
In this, we are going to see the do-while loop, the program is based on the do-while loop which basically Prints Sum of 10 natural numbers with the help of the C Programming language.
 



#include <stdio.h>
int main()
{
    int n = 1;
    int sum = 0;
    do
    {
        sum = sum + n;
        n++;
    } while (n <= 10);
    printf("Sum of first 10 natural numbers is %d ", sum);
    return 0;
}

//..........Coded by ARADHANA MISHRA


#ENJOY CODING

4 Comments

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post