Your Final Result
1st
Attempts
17/30
Marks Obtained
56%
Your Score
Good
Result
Total questions 30
Correct questions 17
Mark for review 0
Unattempted 0
questions
Incorrect questions 13
Your answers
Question 1
Which variable has the longest scope?
#include <stdio.h>
int b;
int main()
{
int c;
return 0;
}
int a;
1. a
2. b
3. c
4. Both (a) and (b)
Question 2
What will be output of the following program?
#include<stdio.h>
int main(){
int a=2,b=7,c=10;
c=a==b;
printf("%d",c);
return 0;
}
1. 0
2. 2
3. 10
4. Compilation error
Question 3
What will be output if you will compile and
execute the following c code?
void main(){
char c=125;
c=c+10;
printf("%d",c);
}
1. 21
2. 18
3. -121
4. Compilation error
Question 4
#include <stdio.h>
int main()
{
signed char chr;
chr = 128;
printf("%d\n", chr);
return 0;
}
1. 128
2. -128
3. Depends on the compiler
4. None of the mentioned
Question 5
What will be output of the following c
program?
#include<stdio.h>
int main(){
int x=100,y=20,z=5;
printf("%d %d %d");
return 0;
}
1. -1477402232 -1477402216 -715596352
2. 5 20 100
3. No Output
4. Compilation error
Question 6
What will be output of the following c
program?
#include<stdio.h>
int main()
{
int goto=5;
printf("%d",goto);
return 0;
}
1. 5
2. No Output
3. Compilation error
4. Linker Error
Question 7
What will be output of the following c
program?
#include<stdio.h>
int main(){
int main = 80;
printf("%d",main);
return 0;
}
1. 80
2. 0
3. Garbage value
4. Compilation error
Question 8
#include <stdio.h>
int main()
{
int var = 010;
printf("%d", var);
}
1. 2
2. 8
3. 9
4. 10
Question 9
What will be output of the following program?
#include<stdio.h>
int main(){
int xyz=20;
{
int xyz=40;
}
printf("%d",xyz);
return 0;
}
1. 20
2. 40
3. 0
4. Compilation –Duplicate variable
Declaration.
Question 10
What is the output of the following program?
#include<stdio.h>
int main(){
printf("%d\t",sizeof(6.5));
printf("%d\t",sizeof(90000));
printf("%d",sizeof('A'));
return 0;
}
1. 8 2 1
2. 4 4 1
3. 8 4 4
4. 4 2 1
Question 11
What will be the output of the following
statements ?
int i = 3;
printf("%d%d",i,i++);
1. Compilation error
2. INF
3. -121
4. 43
Question 12
Determine output:
void main()
int i=0, j=1, k=2, m;
m = i++ || j++ || k++;
printf("%d %d %d %d", m, i, j, k);
}
1. 1 1 2 3
2. 1 1 2 2
3. 0 1 2 2
4. 0 1 2 3
Question 13
Find a correct C Keyword below.
1. work
2. case
3. constant
4. permanent
Question 14
Identify wrong C Keywords below.
1. auto, double, int, struct
2. break, else, long, switch
3. case, enum, register, typedef
4. char, extern, intern, return
Question 15
Types of Real numbers in C are.?
1. float
2. double
3. long double
4. All the above
Question 16
Identify wrong C Keywords below.
1. union, const, var, float
2. short, unsigned, continue, for
3. signed, void, default, goto
4. sizeof, volatile, do, if
Question 17
What is short int in C programming?
1. Basic data type of C
2. Qualifier
3. short is the qualifier and int is the basic
datatypeort is the qualifier
4. All of the mentioned
Question 18
Ranges of signed int and unsigned int are.?
1. 0 to 65535 -32768 to +32767
2. -32768 to +32767 0 to 65535
3. -32767 to +32768 0 to 65536
4. 0 to 65536 -32767 to +32768
Question 19
Types of Integers are.?
1. short
2. int
3. long
4. All the above
Question 20
Which of the datatypes have size that is
variable?
1. int
2. struct
3. float
4. double
Question 21
main()
{
int a = 1, b = 2, c = 3:
printf("%d", a + = (a + = 3, 5, a))
}
1. 6
2. 9
3. 12
4. 8
Question 22
What will this program print?
main()
{
int i = 2;
{
int i = 4, j = 5;
printf("%d %d", i, j);
}
printf("%d %d", i, j);
}
1. 4525
2. 2525
3. 4545
4. None of the these
Question 23
#include <stdio.h>
int main()
{
int x = 0;
if (x++)
printf("true\n");
else if (x == 1)
printf("false\n");
}
1. TRUE
2. FALSE
3. compile time error
4. undefined behaviour
Question 24
#include<stdio.h>
int main()
{
static int i=5;
if(--i){
main();
printf("%d ",i);
}
}
1. 0 0 0 0
2. 4 4 4 4
3. 5 4 3 2 1
4. Compiler error
Question 25
int main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
}
1. Compiler Error
2. 0
3. 120
4. no output
Question 26
What will be the output of the program ?
#include<stdio.h>
void main()
{
printf(5+"Good Morningn");
}
1. Good Morning
2. M
3. Good
4. Morning
Question 27
#include <iostream>
using namespace std;
int main()
{
int y = 10;
if (y++ > 9 && y++ != 11 && y++ > 11)
printf("%d", y);
else
printf("%d", y);
return 0;
}
1. 11
2. 12
3. 13
4. 14
Question 28
#include <stdio.h>
int main()
{
int i = 10;
i = !i > 14;
printf("i=%d", i);
return 0;
}
1. i=1
2. i=0
3. i=10
4. None of These
Question 29
#include <stdio.h>
int main()
{
int i = 0, j = 1, k = 2, m;
m = i++ || j++ || k++;
printf("%d %d %d %d", m, i, j, k);
return 0;
}
1. 1 1 2 3
2. 1 1 2 2
3. 0 1 2 2
4. 1 2 3 3
Question 30
#include <stdio.h>
int main()
{
printf("value is = %d", (10 ++));
return 0;
}
1. 10
2. 11
3. compile time error
4. run time error