Created
September 23, 2015 07:02
-
-
Save cgmb/0e9c63f4e50bfe330b64 to your computer and use it in GitHub Desktop.
How to use printf and scanf in C
This file contains hidden or 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() { | |
| int x, y; | |
| printf("Enter a number: "); | |
| scanf("%d", &x); | |
| printf("Enter another number: "); | |
| scanf("%d", &y); | |
| printf("The sum of %d and %d is %d", x, y, x + y); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment