132k views
3 votes
Develop a c program to display the following input output interphase enter a number 5

The table of 5 is
5*1=5
5*2=10

1 Answer

1 vote

Answer:

int main()

{

int number;

printf("Enter a number: ");

scanf_s("%d", &number, sizeof(number));

for (int i = 1; i <= 2; i++) {

printf("%d*%d=%d\\", number, i, number * i);

}

}

Step-by-step explanation:

I used the safe scanf_s() that takes a third parameter to indicate the size of the buffer. In this case it is the size of an integer.

User Natjo
by
4.2k points