Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions