Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the value of i at the end of the loop? int i = -1; do { i++; } while(i > 0); 1 -1
What is the value of i at the end of the loop?
int i = -1; do { i++; } while(i > 0);
1 | ||
-1 | ||
-2 | ||
0 |
What is the output of the following?
int i, j;
for(i = 0; i < 2; i++) { for(j = i; j >= 0; j--) { printf("%d, %d #", i, j); } }
0, 0 #1, 1 #1, 0 # | ||
0, 0 #1, 1 #2, 1 #1, 0 # | ||
0, 0 #1, 1 #2, 1 #2, 0 #1, 0 # | ||
0, 0 #1, 1 #2, 1 #2, 0 # |
What is printed by the following?
int i; for(i = 10; i >= 0; i-=4) printf("%d, ", i);
10, 6, 2 | ||
10, 6, 2, 0 | ||
10, 6, 2, -2 | ||
2, 6, 10 |
What is the value of count at the end of the loop?
int i, count=0;
for(i = 0; i < 10; i+=2) count++;
5 | ||
4 | ||
10 | ||
9 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started