Computer Science, asked by sanchitamondal996, 11 months ago

Thick the correct answer.
1. which of these is not a control statement?
a. if
b. while
c. for
2. Look at the following code:
if ( age >21 ) :
Print (" mature ")
else :
o
print (" immature ")
what will be printed on the screen if the value of age is 21?
a. nothing
b. mature
c. immature
3. If the condition mentioned in the 'if' block is False , which statement will be executed first?
a. Block after if
b. Block after elif
c. Block after else
4. what will be the output of the following program code if the value of age is 13 ?
if ( age < 13 ) :
print ( " child " )
elif ( age <20):
print (" teenager ")
else
print ( " adult " )
a. child
b. teenager
c. adult

Answers

Answered by syed2020ashaels
5

Answer:

1. if

2.immature

3.block after if

4. teenager

Explanation:

1. if is a conditional statement depending upon the condition the control is given to the system
ex -
if(condition) {    
statement 1; //executes when condition is true  
}    

whereas for and while are the loop statements which is executed on the control of the system
ex -
while(condition){    
//looping statements    
}    

for(initialize; condition ; incriment / decrement) {  
//looping statements      
}

2. As the value of age inputed by the user is 21 which turns if statement as false hence the statement under if is not executed hence else part statement is executed.

3.If the condition mentioned in the 'if' block is False then block after if is considered and is executed

4. Here the value of age entered by the user is 13 so the statement under if is not executed as the condition is not satisfied whereas statement under elif is executed as the condition under elif command is satisfied hence the output we got is teenager.
#SPJ2

Answered by dayashankars628
2

Answer:

  1. a- if
  2. c- immature
  3. a- block after if
  4. b- teenager

Similar questions