
C Programming Quiz

Quiz
•
Computers
•
University
•
Hard
Atharv Sonawane
Used 1+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
Technotsav'23

Quiz
•
University
20 questions
Glitch Hunting Round-1

Quiz
•
University
20 questions
C Program

Quiz
•
University
20 questions
C QUIZ Basics

Quiz
•
University
20 questions
C - Strings

Quiz
•
University
15 questions
Common errors in C programming

Quiz
•
University
20 questions
1st Year quiz

Quiz
•
University
20 questions
PRA UAS - Dasar Dasar Pemrograman 2023

Quiz
•
University
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 Computers
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