Control flow statement 2
Quiz-summary
0 of 10 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Information
Control Flow Statements:
Questions related to
* if condition
* switch statement
* for loop
* while loop
* do while loop
* break
* continue
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 10 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Answered
- Review
-
Question 1 of 10
1. Question
1 points#include
void main()
{
int a=1,b=2;
if(printf(“%d”,printf(“1234”)))
{
printf(“Hello”);
}
else
{
printf(“World”);
}
}Correct
Incorrect
-
Question 2 of 10
2. Question
1 points#include<stdio.h>
void main()
{
int num1=10,num2=20,num3;
num3 = num1>=10 + num2 > 2;
printf(“%d”,num3);
}Correct
Create Table and Decide Priority but make sure that expression does not contain Parenthesis.
Operator Priority Rank
+ 1
> 2
!= 3
= 4
Addition Operator has Highest Priority so “+” Operation evaluated first
Steps of Solving Expression :
Step 1 : num3 = num1 >= 10 + num2 > 2;
[Put Value of num2 ]
Step 1 : num3 = num1 >= 10 + 20 > 2;
Step 2 : num3 = (num1 >= 30 > 2;
Step 3 : num3 = 0 > 2;
Step 4 : num3 = 0;Incorrect
Create Table and Decide Priority but make sure that expression does not contain Parenthesis.
Operator Priority Rank
+ 1
> 2
!= 3
= 4
Addition Operator has Highest Priority so “+” Operation evaluated first
Steps of Solving Expression :
Step 1 : num3 = num1 >= 10 + num2 > 2;
[Put Value of num2 ]
Step 1 : num3 = num1 >= 10 + 20 > 2;
Step 2 : num3 = (num1 >= 30 > 2;
Step 3 : num3 = 0 > 2;
Step 4 : num3 = 0; -
Question 3 of 10
3. Question
1 points#include<stdio.h>
void main()
{
int num=410;
if(num)
printf(“Happy”);
else
printf(“Sad”);
}Correct
Incorrect
-
Question 4 of 10
4. Question
1 points#include<stdio.h>
void main()
{
if(!”True”)
printf(“Hello”);
else
printf(“World”);
}Correct
Incorrect
-
Question 5 of 10
5. Question
1 points#include <stdio.h>
int main()
{
if(!printf(“”))
printf(“Okkk”);
else
printf(“Hiii”);
return 0;
}Correct
Incorrect
-
Question 6 of 10
6. Question
1 points#include <stdio.h>
int main()
{
if(printf(“”))
printf(“Okkk”);
else
printf(“Hiii”);
return 0;
}Correct
Incorrect
-
Question 7 of 10
7. Question
1 points#include <stdio.h>
int main()
{
if(printf(“1”))
printf(“Okkk”);
else
printf(“Hiii”);
return 0;
}Correct
Incorrect
-
Question 8 of 10
8. Question
1 points#include <stdio.h>
int main()
{
int x=22;
if(x=10)
printf(“TRUE”);
else
printf(“FALSE”);
return 0;
}Correct
Correct Answer – TRUE
if(x=10)… “=” is an assignment operator, so 10 will be assigned to x and condition will be true due to if(10)Incorrect
Correct Answer – TRUE
if(x=10)… “=” is an assignment operator, so 10 will be assigned to x and condition will be true due to if(10) -
Question 9 of 10
9. Question
1 points#include <stdio.h>
int main()
{
char val=1;
if(val–==0)
printf(“TRUE”);
else
printf(“FALSE”);
return 0;
}Correct
Incorrect
-
Question 10 of 10
10. Question
1 points#include <stdio.h>
int main()
{
char val=1;
if(–val==0)
printf(“TRUE”);
else
printf(“FALSE”);
return 0;
}Correct
Incorrect