1. In the C programming language to scan the integer type data which of the following is used?
Answers
Answered by
1
Answer:
#include <stdio.h>
int main() {
int number;
printf("Enter an integer: ");
// reads and stores input
scanf("%d", &number);
// displays output
printf("You entered: %d", number);
return 0;
}
Output:
Enter an integer: 25
You entered: 25
In this program, an integer variable number is declared.
int number;
Then, the user is asked to enter an integer number. This number is stored in the number variable.
printf("Enter an integer: ");
scanf("%d", &number);
Finally, the value stored in number is displayed on the screen using printf().
printf("You entered: %d", number);
Similar questions
Physics,
1 month ago
Math,
1 month ago
Social Sciences,
2 months ago
Math,
2 months ago
Geography,
9 months ago