C Program for adding two Numbers / Integers
Simple C Program for adding two numbers :
PROGRAM:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include<stdio.h> int main() { int x; int y; int result; printf("\n Enter the first number to be added: "); scanf("%d",&x); printf("\n Enter the second number to be added: "); scanf("%d",&y); result = x + y; printf("\n The sum of two numbers is: %d",result); return 0; } |
Sample Output:( using GNU GCC Compiler with Code Blocks IDE )
Enter the first number to be added: 10
Enter the second number to be added: 15
The sum of two numbers is: 25