2- Decision Making Flashcards

1
Q

C programming language assumes any non-zero and non-null values as true

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

C programming language assumes any zero or null values as false

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A is less than 20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A is not less than 20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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?

A

Value of a is 30

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following is branching statement of C language?

A

If…else statement
switch statement
if statement
(All of these)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

____________ is the built in multiway decision statement in C

A

Switch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A program stops its execution when break statement is encountered.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly