C Program Declaring variable and printing its value .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <stdio.h> int main() { int number; // printf() displays 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: %d", number); return 0; } |
Output is:
1 2 |
Enter a integer: 20 You entered: 20 |