BUG@MASTER

Quiz
•
Computers
•
University
•
Hard
SUNNY 21GPTC4060022
Used 1+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Point out the error, if any in the program.
#include<stdio.h>
int main()
{
int a = 10;
switch(a)
{
}
printf("This is c program.");
return 0;
}
Error: No case statement specified
Error: No default specified
Error: infinite loop occurs
No Error
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Point out the error, if any in the program.
#include<stdio.h>
int main()
{
int i = 1;
switch(i)
{
printf("This is c program.");
case 1:
printf("Case1");
break;
case 2:
printf("Case2");
break;
}
return 0;
}
Error: No default specified
Error: Invalid printf statement after switch statement
None of above
No Error and prints "Case1"
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Point out the error, if any in the while loop.
#include<stdio.h>
int main()
{
int i=1;
while()
{
printf("%d\n", i++);
if(i>10)
break;
}
return 0;
}
There should be at least a semicolon in the while
The while loop should be replaced with for loop
There should be a condition in the while loop
No error
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Point out the error, if any in the program.
#include<stdio.h>
int main()
{
int i = 1;
switch(i)
{
case 1:
printf("Case1");
break;
case 1*2+4:
printf("Case2");
break;
}
return 0;
}
Error: in switch statement
Error: in case 1*2+4 statement
No Error
Error: No default specified
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Point out the error, if any in the while loop.
#include<stdio.h>
int main()
{
int i=1;
while()
{
printf("%d\n", i++);
if(i>10)
break;
}
return 0;
}
There should be at least a semicolon in the while
The while loop should be replaced with for loop
No error
There should be a condition in the while loop
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf("Hello World! %d\n", y);
return 0;
}
Hello World! 34
Compile time error
Hello World! 1000
Hello World! followed by a junk value
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the final values of i and j in the following C code?
#include <stdio.h>
int x = 0;
int f()
{
if (x == 0)
return x + 1;
else
return x - 1;
}
int g()
{
return x++;
}
int main()
{
int i = (f() + g()) | g(); //bitwise or
int j = g() | (f() + g()); //bitwise or
}
i value is 1 and j value is 1
i value is 0 and j value is 0
i value is 1 and j value is undefined
i and j value are undefined
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Algoritma dan Pemrograman

Quiz
•
University
30 questions
OODP FT1

Quiz
•
University
25 questions
ROUND 1

Quiz
•
University
30 questions
C-Programming

Quiz
•
University
25 questions
Aptitude Competition(FY)

Quiz
•
University
30 questions
Branch Master CSE Round 1(Quiz)

Quiz
•
University
35 questions
C PROGRAMMING FOR 2ND AND 3RD YEAR

Quiz
•
University
25 questions
Estructura de Datos

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University