179k views
0 votes
Write a single c statement to read an integer from the keyboard and assign it variable "num"

User Arturn
by
4.6k points

1 Answer

3 votes

Answer:

The statement in c is as follows

scanf("%d", &num);

Step-by-step explanation:

In c, the keyword scanf is used to accept input

%d refers to format specifier and it is used when the declared variable is integer;

Note: I'll assume that the variable "num" has already been declared as integer

So, the required statement is :

scanf("%d", &num);

User TienLuong
by
4.7k points