2- Decision Making Flashcards
C programming language assumes any non-zero and non-null values as true
True
C programming language assumes any zero or null values as false
True
int a = 10;
if( a < 20 )
{
printf(“a is less than 20\n” );
}
Given the source code above, what would output to the command prompt or terminal as a result of the if condition?
A is less than 20
int a = 30;
if( a < 20 )
{
printf(“a is less than 20\n” );
}
else
{
printf(“a is not less than 20\n” );
}
Given the source code above, what would output to the command prompt or terminal window?
A is not less than 20
int a = 30;
if( a == 10 ) { printf("Value of a is 10\n" ); } else if( a == 20 ) { printf("Value of a is 20\n" ); } else if( a == 30 ) { printf("Value of a is 30\n" ); }
Given the source code above, what would output to the command prompt or terminal window?
Value of a is 30
Which of the following is branching statement of C language?
If…else statement
switch statement
if statement
(All of these)
____________ is the built in multiway decision statement in C
Switch
A program stops its execution when break statement is encountered.
True