In this example, We are going to take one integer input from user and print that value to output window.
In this Example, We are going to use scanf() function to take user input and printf() function to print.
Example :
#include<stdio.h>
int main() {
//Define Number Variable As Integer
int number;
//Get User Input
printf("Enter an integer: ");
scanf("%d", &number);
// displays output
printf("You entered: %d", number);
return 0;
}
Output :
Enter an integer: 10
You entered: 10
Ask anything about this examples