In this C program, we will learn how to write a program to print an input(Entered by the User). In this program, we are displaying the message using printf
function and read the input taken from the user using scanf
function.
Here is the code of the program to print an input(Entered by the User).
/*C Program to Print an Integer (Entered by the User)*/
#include <stdio.h>
int main()
{
int number;
// printf() dislpays the formatted output
printf("Enter an integer: ");
// scanf() reads the formatted input and stores them
scanf("%d", &number);
// printf() displays the formatted output
printf("You entered the Integer: %d", number);
return 0;
}
Enter an integer: 55
You entered the Integer: 55
--------------------------------
Process exited after 2.377 seconds with return value 0
Press any key to continue . . .
Comments