Input and Output of an integer C Program

Estimated read time 2 min read

Explanation: This Input and Output of an integer C Program demonstrates the input and output of an integer in C programming language.

The scanf function is used to take input from the user and store it in the variable num. The %d format specifier is used to read an integer value. The ampersand & symbol is used to get the address of the variable num. The printf function is used to print the message “The number you entered is: %d” on the screen.

Input and Output of an integer C Program
Input and Output of an integer C Program
#include <stdio.h>

int main()
{
    int num;
    printf("Enter a number: ");
    scanf("%d", &num);
    printf("The number you entered is: %d", num);
    return 0;
}
OUTPUT 
Enter a number: 4
The number you entered is: 4
admin https://study-from-here.com

Digital Marketing Consultants and Social Media Marketing Expert with over 3 years of rich experience in various Branding, Promotions, business directories, On pages and off page optimization, Link building Advertising, Research, paid advertisement, content writing and marketing

You May Also Like

More From Author

1 Comment

Add yours

+ Leave a Comment