Read user input and print to output.
Write a statement that reads an integer into userNum, and a second statement that prints userNum followed by a newline.
Hint — Replace the ?s in the following code:
?("%d", &userNum); printf("%d\n", ? );
#include <stdio.h> int main(void) { int userNum = 0; scanf("%d", &userNum); printf("%d\n", userNum ); return 0; }
Read multiple user inputs.
#include <stdio.h> int main(void) { int birthMonth; int birthYear; scanf("%d", &birthMonth); scanf("%d", &birthYear); printf("%d/%d\n", birthMonth, birthYear); return 0; }