
C Programming Quiz
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Atharv Sonawane
Used 1+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h> int main() { static int i; for(i = 1;;++i) { if(i == 5) break; printf("%d ",i++); } }
1 3
1 2 3 4
1 2 3
1 2 3 4 5
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h> int main() { char a = 10,b = 20; printf("%d\n",scanf("%d %*d",&a,&b)); // Assume input to be : 123 456 printf("a = %d\n",a); printf("b = %d",b); }
1 a = 10 b = 456
1 a = 123 b = 20
2 a = 123 b = 456
2 a = 123 b = 20
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h> int foo() { static int i; return ++i*2; } int main() { printf("%d",foo()*foo()*foo()); }
48
16
64
24
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include <stdio.h> int main() { int arr[] = {10, 20, 30, 40}; int *ptr = arr; printf("%d ",*ptr++); printf("%d",*++ptr); }
10 30
10 20
20 30
20 40
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h> int fun(int n) { if(n <= 1) return 1; return n + fun(n--); } int main() { printf("%d",fun(5)); }
15
16
Infinite loop / Stack overflow
Compilation error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h> struct A { char a; int b; char c; }; struct B { float a; int b; int c; }; int main() { if(sizeof(struct A) == sizeof(struct B)) printf("Equal"); else printf("Not Equal"); }
Equal
Not Equal
Compilation Error
Runtime Error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h> int main() { int x = 8; printf("%d",(x & 1) ? x >> 1 : x << 1); }
0
4
16
Compilation Error
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Control Structures C#
Quiz
•
University
19 questions
Programación Básica Prácticas Tema 2
Quiz
•
University
15 questions
Internet Gateway
Quiz
•
University
16 questions
Think it through
Quiz
•
University - Professi...
15 questions
Fundamentals of Algorithms - Unit 1 - Test 1
Quiz
•
University
20 questions
Analisis y diseño de sistemas
Quiz
•
University
20 questions
Web Designing Quiz-1
Quiz
•
University
20 questions
POO_BasicoyJava
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
