C Program to Print an Integer (Entered Manually)

Image result for C PROGRAM TO PRINT AN INTEGER (ENTERED MANUALLY)
#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: %d", number);
    return 0;
}
Output

Enter a integer: 50
You entered: 50

In this program, an integer variable number is declared.

The printf() function displays Enter an integer: on the display board. Then, the scanf() function reads an integer data from the user and stores in variable number.

At last, the value stored in the variable number is shown on the display board using printf() function.

No comments