What will be the output of the following code? #include int main() { int a = 5; int *p = &a; *p += *p * 2; printf("%d\n", a); return 0; }

C Programming Quiz level 2

Quiz
•
Others
•
1st Grade
•
Hard
Kaustubh Pandey
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
5
10
15
20
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? #include int main() { int arr[] = {10, 20, 30, 40, 50}; int *ptr = arr + 2; printf("%d\n", *ptr); return 0; }
10
20
30
40
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? #include void update(int x) { x = x * 2; } int main() { int a = 10; update(a); printf("%d\n", a); return 0; }
10
20
0
Compilation Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? #include int main() { int x = 5; // binary: 0101 int y = 9; // binary: 1001 printf("%d\n", x ^ y); return 0; }
12
14
4
0
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? #include int main() { int arr[2][2] = {{1, 2}, {3, 4}}; printf("%d\n", *(*(arr + 1) + 1)); return 0; }
1
2
3
4
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? #include int main() { char *ptr = "Hello"; ptr += 3; printf("%s\n", ptr); return 0; }
Hello
lo
llo
Syntax Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? #include int main() { int a = 1, b = 0, c = 3; if (a || ++b && c) { c += a; } printf("%d\n", c); return 0; }
3
4
5
Compilation Error
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
CJs 2024 reviews ♥️

Quiz
•
1st Grade
14 questions
One Summer Night Quiz

Quiz
•
1st - 5th Grade
10 questions
Instrument Game

Quiz
•
1st Grade
15 questions
Soalan Algoritma Bab 3 Tingkatan 1

Quiz
•
1st Grade
20 questions
Learn About Computers

Quiz
•
1st Grade
15 questions
BETM BN Nathan

Quiz
•
1st Grade
20 questions
QUIZ-A-THON PYTHON LEVEL 1

Quiz
•
1st Grade
15 questions
Quiz tentang Transmisi Otomatis

Quiz
•
1st - 5th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Others
10 questions
American Flag

Quiz
•
1st - 2nd Grade
10 questions
Identifying equations

Quiz
•
KG - University
25 questions
2.4A Add Subtract within 20 quickly: set 3

Quiz
•
1st - 3rd Grade
15 questions
Music 2016

Quiz
•
KG - 12th Grade
12 questions
Summer Trivia

Quiz
•
1st - 5th Grade
44 questions
logos

Quiz
•
KG - University
20 questions
Guess that Disney

Quiz
•
KG - 5th Grade
20 questions
Cartoon Characters!

Quiz
•
KG - 5th Grade