Question: Can you help me answer the following C programming questions? Thanks Multiple choice 1. What is the value of i at the end of the

Can you help me answer the following C programming questions? Thanks

Multiple choice

1. What is the value of i at the end of the loop?

int i; for(i = 0; i < 5; i++) { printf("%d ", i); }

a. 6

b. 0

c. 4

d. 5

2. What is the value of i at the end of the loop?

int i = -1; do { i++; } while(i > 0);

a. -1

b. 0

c. -2

d. 1

3. What is the value of count at the end of the loop?

int i, count=0;

for(i = 0; i < 10; i+=2) count++;

a. 9

b. 5

c. 4

d. 10

4. 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); } }

a. 0, 0 #1, 1 #1, 0 #

b. 0, 0 #1, 1 #2, 1 #2, 0 #1, 0 #

c. 0, 0 #1, 1 #2, 1 #1, 0 #

d. 0, 0 #1, 1 #2, 1 #2, 0 #

5. What is printed by the following?

int i; for(i = 10; i >= 0; i-=4) printf("%d, ", i);

a. 10, 6, 2, 0

b. 10, 6, 2

c. 10, 6, 2, -2

d. 2, 6, 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!