Q.3
What is the following program doing?
main
()
{
int d = 1;
do
printf(“%d\n”,
d++);
while
(d < = 9);}
(A)
Adding 9 integers (B) Adding integers from 1 to 9
(C)
Displaying integers from 1 to 9 (D) None of these
Ans:
C
d
starting from 1 is incrementing one by one till d=9 so the printf statement is
printing
numbers
from 1 to 9.
No comments:
Post a Comment