Question

What is printed when the following code is executed? #include <stdio.h> int main() { for (int i=3, j=5; i>=0; i-=2, j+=j*i) {

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

Question :

Answer :510

Explanation :

Given table shows the tracing

i j i>=0 j i-=2 j+=j*i
3 5 true 5 i=3-2=1 =5+5*1=10
1 10 true 10 i=1-2=-1 j=10+10*-1=0
-1 0 false -- -- --

hence value of j that is 510 will be printed as output

Below screen shows the output

main.c 1 #include <stdio.h> 2 int main() 3- { 4 for(int i=3,j=5;i>=0; i--2,j+=j i) 5 6 printf(%d,j);//print value of jl 7 r

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
What is printed when the following code is executed? #include <stdio.h> int main() { for (int...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT