Home C Programming Language / Programs / Program to display first 10 natural no. & their sum.
🚀 Programming Example

Program to display first 10 natural no. & their sum.

👁 4,342 Views
💻 Practical Program
📘 Step Learning
Program to display first 10 natural no. & their sum.
No previous program
No next program

💻 Program Code

/* Program to display first 10 natural no. & their sum.
  Author: Atnyla Developer */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,sum=0;
 
for(i=1;i<=10;i++)
{
	printf("%d no is= %d\n",i,i);
	sum=sum+i;
}
	printf("sum =%d",sum);
}

                        

🖥 Program Output

1 no is= 1
2 no is= 2
3 no is= 3
4 no is= 4
5 no is= 5
6 no is= 6
7 no is= 7
8 no is= 8
9 no is= 9
10 no is= 10
sum =55 
                            

📘 Explanation

Program to display first 10 natural no. & their sum.
No previous program
No next program
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.