Question 1: What is the output of the following code?
c
#include <stdio.h>
int main() {
int x = 5;
int y = x++;
printf("%d", y);
return 0;
}
IEEE VEC SB
Quiz
•
Computers
•
University
•
Hard
Ruthvik Vr
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 1: What is the output of the following code?
c
#include <stdio.h>
int main() {
int x = 5;
int y = x++;
printf("%d", y);
return 0;
}
A) 5
B) 6
C) 7
D)8
Answer explanation
a
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 2: What will be the value of 'y' after this code is executed?
c
#include <stdio.h>
int main() {
int x = 3;
int y = x++ + ++x;
printf("%d", y);
return 0;
}
A) 6
B) 7
C) 8
D) 10
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 3: What is the output of the following code?
c
#include <stdio.h>
int main() {
int x = 5;
printf("%d", x++);
return 0;
}
A) 4
B) 5
C) 7
D) 9
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 4: What is the output of the following code?
c
#include <stdio.h>
int main() {
int x = 5;
printf("%d", ++x);
return 0;
}
A) 5
B)6
C) 7
D) 111
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 5: What is the size of the character array "str" in bytes in the following code?
c
#include <stdio.h>
int main() {
char str[] = "Hello, World!";
printf("%d", sizeof(str));
return 0;
}
A) 12
B) 14
C) 13
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 6: What is the value of 'x' after this code is executed?
c
#include <stdio.h>
int main() {
int x = 5;
x *= x + 1;
printf("%d", x);
return 0;
}
A) 25
B) 30
C) 35
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Question 7: What is the value of 'y' after this code is executed?
c
#include <stdio.h>
int main() {
int x = 10;
int y = x > 5 ? x++ : x--;
printf("%d", y);
return 0;
}
V
A) 10
B) 11
C) 9
25 questions
C Quiz 1
Quiz
•
University
25 questions
C- Geniusia
Quiz
•
University
30 questions
C Language Quiz
Quiz
•
University
25 questions
Aptitude Competition(FY)
Quiz
•
University
30 questions
Code debugging - Round 1
Quiz
•
University
25 questions
C Programing
Quiz
•
University
25 questions
GNIDOC ROUND 1
Quiz
•
University
30 questions
C-Programming
Quiz
•
University
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