Programming Chunks
In My Words
Tuesday, November 12, 2013
C++ For Loop Program Conversion to If Else Statement Program
Given the following C++ code:
int j, sum = 0;
for (j = 0; j < 10; j++)
sum += j;
cout<<sum;
Re-write the C++ statements so that they compute the same quantity but using decision statement (if-else) instead of for loop.
No comments:
Post a Comment
Please comment, if you like the post, you find any mistake or if you have any query.
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please comment, if you like the post, you find any mistake or if you have any query.