Skip to content

Instantly share code, notes, and snippets.

@cgmb
Created September 23, 2015 07:02
Show Gist options
  • Select an option

  • Save cgmb/0e9c63f4e50bfe330b64 to your computer and use it in GitHub Desktop.

Select an option

Save cgmb/0e9c63f4e50bfe330b64 to your computer and use it in GitHub Desktop.
How to use printf and scanf in C
#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