Skip to Main Content
Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
book

Xpress Learning - Computer Fundamentals of Programming an IT by Pearson

by Ashok N. Kamthane, Rohit Khurana
May 2024
Beginner to intermediate content levelBeginner to intermediate
465 pages
16h 14m
English
Pearson India
Content preview from Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
Loop Control Statements II-117
22. What is the output of the following program?
void main()
{
int nm=0;
do
{
--nm;
printf ("%d",nm);
nm++;
}
while(nm>=0);
}
(a) The loop will run infinitely. (b) The program will not be compiled.
(c) Loop will not be executed.
23. What will be the value of s after execution of the following program?
void main()
{
int i=5,a=1;
int s=0;
clrscr();
do
{s=s+a++;
} while (a<=i);
printf ("\b\bs=%d",s);
}
(a) s = 15 (b) s = 36 (c) s = 40
24. How many 'while' statements are possible in 'do-while' loop?
(a) 2 (b) 1 (c) 3 (d) None of the above
25. The for (; ;) is equivalent to .
(a) while (false) (b) while (true) (c) while (0) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Express Learning - Computer Fundamentals and Programming

Express Learning - Computer Fundamentals and Programming

Ashok Kamthane, ITL ESL
Windows® Internals, Sixth Edition, Part 2

Windows® Internals, Sixth Edition, Part 2

David A. Solomon Mark E. Russinovich and Alex Ionescu

Publisher Resources

ISBN: 9781299954878