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
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