Answer to Question #4712 in C++ for Rajveer

Question #4712
what will be the output by following code:
for(i=10;i<=50;l+=10)
{
j=i/2
cout<<j<<"";
}
1
Expert's answer
2011-10-21T11:44:01-0400
it does not work because of numerous mistakes. We'll try to understand what you wanted to write.


for(i=10; i<==50; i+=10)
{
j=i/2;
cout<<lt<<j;

}

may be this way. So we have loop "for" here. i initializes as 10 and increases on 10 every iteration until i< equals 50. But this condition
will never occur. (it is possible if i=50 and lt=50 but initially i=10 and not
iteration will be executed).





So in every iteration we count j: j=i/2; and write lt and j on console.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS