What will this program print?
main()
{
int i = 2;
{
int i = 4, j = 5;
printf("%d %d", i, j);
}
printf("%d %d", i, j);
}
C-Extended
Quiz
•
Computers
•
University
•
Hard
Niranjan C
Used 13+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What will this program print?
main()
{
int i = 2;
{
int i = 4, j = 5;
printf("%d %d", i, j);
}
printf("%d %d", i, j);
}
4525
2525
4545
None of the these
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
int x = 5;
int y = 3;
int z = x + y;
printf("%d", z);
5
15
2
8
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following expression?
int a = 10;
int b = 5;
int c = a * b + 2;
printf("%d", c);
52
50
25
15
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the value of 'num' after executing the following code?
int num = 7;
num += 3;
num *= 2;
printf("%d", num);
20
25
15
10
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int main()
{
int x;
for(x=-1; x<=10; x++)
{
if(x < 5)
continue;
else
break;
printf("javaTpoint");
}
return 0;
}
0 times
12 times
11 times
Infinite times
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include<stdio.h>
int main()
{
int i=1;
while(i <= 155)
{
printf("%c %d\n", i, i);
i++;
}
return 0;
}
154 times
155 times
156 times
Infinite times
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
#include<stdio.h>
int main()
{
int i = 8, j = 24;
if(i = 8) && if(j = 24)
printf("Welcome Programmer");
return 0;
}
Welcome Programmer
Error: Undeclared identifier if
Error: Expression syntax
No output
15 questions
BASIC C PROGRAMMING QUIZ
Quiz
•
University
13 questions
C programming-1
Quiz
•
University
12 questions
Operators in C
Quiz
•
University
20 questions
C - Structures
Quiz
•
University
15 questions
Common errors in C programming
Quiz
•
University
20 questions
1st Year quiz
Quiz
•
University
13 questions
ÔN TẬP C - mảng 1 chiều
Quiz
•
University
20 questions
C - Strings
Quiz
•
University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade