C Programming Quiz

Quiz
•
Computers
•
12th Grade - University
•
Hard
Ebenesar J
Used 654+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
hi
hello
no
error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x == 0)
printf("inside if\n");
else
printf("inside else if\n");
else
printf("inside else\n");
}
inside if
inside else if
inside else
compile time error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x >= 0)
printf("true\n");
else
printf("false\n");
}
Depends on the compiler
No print statement
True
False
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
The switch statement takes a given integer value then seeks a matching value among a number of _______ statements.
break
case
switch
goto
5.
MULTIPLE CHOICE QUESTION
5 sec • 1 pt
How many loops are there in C
1
3
2
4
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which of the following is an exit control statement
for
while
do while
continue
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
The value of i after the execution of the following segment is
i = 2;
for( i=0; i>10; i=i+1);
1
2
0
11
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
C - Strings

Quiz
•
University
20 questions
Pointers

Quiz
•
University
20 questions
EST102 : PROGRAMMING IN C TEST 1

Quiz
•
University
15 questions
C programming

Quiz
•
University
16 questions
PSC ALM QUIZ

Quiz
•
University
15 questions
Milking Minds 2 17-01-24

Quiz
•
University
15 questions
Common errors in C programming

Quiz
•
University
20 questions
1st Year quiz

Quiz
•
University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade