Home / Programs / Program to find sum of two numbers
🚀 Programming Example

Program to find sum of two numbers

👁 1,232 Views
💻 Practical Program
📘 Step Learning
Addition of two number in c: In this program, we are going to add two numbers which are taken from the user

💻 Program Code

#include<stdio.h><br />#include<conio.h><br />void main()<br />{<br /> int a,b,s; <br /> printf("Enter two no: ");<br /> scanf("%d%d",&amp;a,&amp;b);<br /> s=a+b;<br /> printf("sum=%d \n",s); <br />}
                        

🖥 Program Output

Enter two no: 5 10
sum=15
Press any key to continue . . .
                            

📘 Explanation

We take two number 5 and 10 output=(5+10)=15
📚 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.