Created
May 28, 2017 07:09
-
-
Save NitishDiwakar/7d0712f05a92b697b444de9e6f08356a to your computer and use it in GitHub Desktop.
Addition in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
// declare three variables. | |
int a = 0, b = 0, sum = 0; | |
printf("Please enter a number: \n" ); | |
// read first variable | |
scanf("%d", &a); | |
printf("Please enter second number: \n" ); | |
// read second variable | |
scanf("%d", &b); | |
// calculate sum of two variables | |
sum = a + b; | |
// show result | |
printf("The sum of %d and %d is %d \n", a, b, sum ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment