
c aptitude

Quiz
•
Computers
•
University
•
Hard

paaventhan 91
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1) What will be the output of following program ?
#include <stdio.h>
void main()
{
char cnt=0;
for(;cnt++;printf("%d",cnt)) ;
printf("%d",cnt);
}
a)0 1 2 ... infinite times
b)0 1 2 ... 127
c)0
d)1
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
2)What will be the output of following program ?
#include < stdio.h >
void main()
{ unsigned char var=0;
for(var=0;var<=255;var++)
{
printf("%d ",var);
}
}
0 1 2 ... infinite times
0 1 2 ... 255
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
3) What will be the output of following program ?
#include < stdio.h >
int main()
{
int tally=0;
for(;;)
{
if(tally==10)
break;
printf("%d ",++tally);
}
return 0;
}
1 to 10
0 to 10
1 to 11
0 to 11
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
4)What will be the output of following program?
#include <stdio.h>
#define TRUE 1
int main()
{
int loop=10;
while(printf("Hello ") && loop--);
}
a)Hello
b)Hello Hello Hello Hello ... (Infinite times)
c)Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello
d)Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
5)What will be the output of following program ?
#include<stdio.h>
int x = -1;
int main()
{
while(x++ == 1)
printf("loop");
return 0;
}
a)Prints Nothing
b) loop
c) loop loop
d) loop loop loop
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
6) What will be the output of the C program?
#include<stdio.h>
int main(){
while(printf("%d", 5) < 4)
printf("Loop ");
return 0; }
5Loop once
5Loop 4 times
5Loop infinite times
none of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
7)What will be the output of the C program?
#include<stdio.h>
int main() {
int i = 1, j = 1;
for(--i && j++ ; i<10; i+=2)
{ printf("loop ");
}
return 0;
a)Compilation error
b)Program never ends
c) loop loop loop loop loop
d) None of the above
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
C - Structures

Quiz
•
University
16 questions
C-Extended

Quiz
•
University
20 questions
DSA quiz

Quiz
•
University
20 questions
Quiz

Quiz
•
University
15 questions
C Quiz 4_M

Quiz
•
University
15 questions
ARRAYS AND FUNCTIONS

Quiz
•
University
20 questions
C Programming: Input and Output

Quiz
•
University
20 questions
BGSCET - INFORMATION SCIENCE & ENGINEERING

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