
If else Quiz

Quiz
•
Other
•
University
•
Hard
Jayasheela Kallaganiger
Used 3+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int x = 0;
int main()
{
if(x == x)
printf("hai this is if");
else
printf("hai this is else");
return 0;
}
hai this is if
hai this is else
prints nothing
compiler error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
#define FALSE -1
#define NULL 0
#define TRUE 1
int main()
{ if(NULL)
printf("NULL");
else if(FALSE)
printf("TRUE");
else printf("FALSE");
return 0; }
FALSE
TRUE
NULL
COMPILATION ERROR
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int main()
{
char str[8] = "if block";
if(str == "if block")
printf("if block executed");
else
printf("else block executed");
return 0;
}
if block executed
else block executed
COMPILATION ERROR
NONE OF THE ABOVE
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int main()
{
char str[] = "\0";
if(printf("%s",str))
printf("inside if block");
else
printf("inside else block");
return 0;
}
inside else block
inside If block
compilation Error
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
#define NULL 0
int main()
{
if(printf("0") == NULL)
printf("inside if block");
else
printf("inside else block");
return 0;
}
0 inside if block
0 inside else block
0 inside else block
inside if block
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int main()
{
int i = 1, j = 0 ; if(i-- == j)
printf("i = %d", --i);
else printf("j = %d", ++j);
return 0;
}
i=1
i=-1
j=0
j=1
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int main()
{
int i; if(true)
printf("This will work");
else
printf("This will not work");
return 0;
}
This will work
This will not work
Compilation Error
Runtime Error
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
CB quiz

Quiz
•
University
20 questions
Primitive Types

Quiz
•
10th Grade - University
20 questions
CodeMavarick

Quiz
•
University
20 questions
TECHTRIX2025 BUGHUNT SET6

Quiz
•
University
17 questions
Basics of Programming with C

Quiz
•
University
20 questions
Chương 2

Quiz
•
University
20 questions
Round 3

Quiz
•
University
22 questions
Funções e Estruturas em Programação C - Parte I

Quiz
•
9th Grade - Professio...
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University