Question: Can you please help me answer the following C programming questions. 1 . The following if is incorrect. It is trying to execute some code

Can you please help me answer the following C programming questions.

1. The following if is incorrect. It is trying to execute some code if a has the value 3 or 4. Type a corrected version of it without making major changes to the order in the expression.

if(a == 3 || 4)

______________

multiple choice

1. What is wrong with the following? if(a > 3)

printf("a is big ");

printf("but not big enough ");

a. The indentation indicates 2 statements are within the true part of the if, but only 1 statement is in the true part

b. The first printf should be on the same line as the if.

c. You cannot have 2 printf statements in an if.

d. The printf statements should be on one line.

2. What is wrong with the following?

if( a > 3);

printf("a is big ");

a. The printf should be on the same line as the if.

b. There should not be a semicolon at the end of the printf.

c. There should not be a semicolon at the end of the if.

d. The printf should be in curly braces.

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!