C Programming to find the sum of two numbers | quicklearn

in #c7 years ago

A simple c-program to find the sum of any two numbers. It is the most basic program you must know for beginners. WAP to find the sum of two numbers.(i.e. a & b)

Best software to practice c-programming:- Turbo C/C++:- https://goo.gl/7QxTU2
Codeblocks:- https://goo.gl/YiWMR6

download (16).jpg

Program to display sum of any two numbers:-

#include <stdio.h> ------------------ Header file
#include <conio.h> ------------------ Header file

void main ( ) ------------------ main( )

{

int a,b,sum; ------------------ Declaration Part

printf("Enter any two numbers:"); |
scanf("%d %d",&a,&b); |
sum=a+b; | ------------- Executable Part
printf("The sum of the two numbers is %d",sum); |
getch(); |

}

Output of the Program
Enter any two numbers:

2 |__________ Your Input (i.e. 2 & 3)
3 |

The sum of the two numbers is 5 |--------------- Final output of the Inputs