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-107
18.  Write a program to illustrate an example of 'nested for' loops.
Ans: 
Explanation:  Here, in the above example, for each value of i, the inner loop's j
value varies from 1 to 2.
Outer loop executes three times whereas the inner loop executes six times. The inner loops terminates
when the value of j = 2 and the outer loop terminates when the value of i = 3. The total number of
iterations = outer loop iterations (3) * inner loop iterations (2) = 6.
19.  Is it possible to create 'for' loop that never executes?
Ans:  Yes, we can create 'for' loop that never executes when initial condition itself is not true. ...
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