C Program to Print an Integer (Entered by the User)
In this example, we learn how to print an integer(entered by the user) on the screen.
Remainder :
To understand this example, you must have the knowledge of the following C programming topics:
Program to Print an Integer
#include <stdio.h>
int main() {
int num;
printf("Enter a number : ");
scanf("%d", &num);
printf("Number is %d", num);
return 0;
}
Output
Enter a number : 47
Number is 47
Working of the above program
- An integer variable num is declared.
int num;
printf("Enter a number : ");
scanf("%d", &num);
printf("Number is %d", num);