Questions
Questions
Questions
#include<stdio.h>
main()
int const a = 5;
a++;
printf(“%d”,a);
A-5
B-6
C - Runtime error
D - Compile error
Answer : D
Q 2 - What is the output of the following program?
#include<stdio.h>
main()
int i = 1;
while( i++<=5 )
printf("%d ",i++);
A-135
B-24
C-246
D-2
Answer : C
Q 3 - What is the output of the following program?
#include<stdio.h>
main()
printf("%d", *a);
A-0
B-1
C-2
D - Compile error.
Answer : C
Q 4 - Choose the correct option in respect to the following program.
#include<stdio.h>
i=5;
main()
{
int x = 10;
f(x);
C - Statement I is true
D - Statement II is true.
Answer : D
Q 5 - Similarity between a structure, union and enumeration,
Answer : B
Q 6 - To print a double value which format specifier can be used?
A - %L
B - %lf
C - %Lf
Answer : B
Q 7 - What is the output of the following code snippet?
#include<stdio.h>
main()
int const a = 5;
a++;
printf(“%d”,a);
A-5
B-6
C - Runtime error
D - Compile error
Answer : D
Question: 8
How many main() function we can have in our project?
(A) 1
(B) 2
(C) No Limit
(D) Depends on Compiler
Ans: A
Question: 9
What is sizeof() in C?
(A) Operator
(B) Function
(C) Macro
(D) None of these
Ans: A
Question: 10
int main()
extern int i;
i = 20;
printf("%d", sizeof(i));
return 0;
(A) 20
(B) 0
(C) Undefined reference to i
(D) Linking Error
Ans: C
Question: 11
Is the following statement a declaration or definition
extern int i;
(A) Declaration
(B) Definition
Ans: A
Question: 12
main()
int x = 10;
int x = 0;
printf("%d",x);
}
}
(A) 10
(B) Compilation Error
(C) 0
(D) Undefined
Ans: C
Question: 13
int x = 10;
int main()
int x = 0;
printf("%d",x);
return 0;
(A) 10
(B) 0
(C) Compilation Error
(D) Undefined
Ans: B
Question: 14
//This question is compiled on 32 bit DEV-C++
int main()
return 0;
(A) 1 1
(B) 2 2
(C) 4 4
(D) Undefined
Ans: C
Question: 15
Which programming language is more faster among these?
(A) Java
(B) Php
(C) C
(D) Visual Basix
Ans: C
Question: 16
What should be the output:
void main()
int a = 10/3;
printf("%d",a);
(A) 3.33
(B) 3.0
(C) 3
(D) 0
Ans: C
Question: 17
Which of the following is executed by Preprocess?
(A) #include<stdio.h>
(B) return 0
(C) void main(int argc , char ** argv)
(D) None of above
Ans: A
Question: 18
void main()
int a = 10.5;
printf("%d",a);
(A) 10.5
(B) 10
(C) 0
(D) Compilation Error
Ans: B
Question: 19
int main()
int x;
x=10,20,30;
printf("%d",x);
return 0;
}
(A) 10
(B) 20
(C) 30
(D) Compilation Error
Ans: A
Question: 20
void main()
int a = 0;
while(a++ < 5)
printf("CppBuzz.com");
}
(A) 4 times
(B) 5 times
(C) 0 time
(D) Infinite times
Ans: B
Question: 21
void main()
{
int a = 0;
while(a==0)
printf("CppBuzz.com");
}
(A) 0 times
(B) Infinite times (Untill Stack is overflow)
(C) 1 time
(D) Nothing is printed
Ans: B
Question: 22
void main()
int a = 0;
while(a)
printf("CppBuzz.com");
}
(A) CppBuzz.com is printed Infinite times
(B) CppBuzz.com is printed 1 time only
(C) Nothing is printed
(D) Program gives error
Ans: C
Question: 23
void main()
for(; ;);
for(; ;);
printf("Hello");
}
(A) Compilation Error
(B) Runtime Error
(C) Nothing is printed
(D) Hello is printed infinite times
Ans: C
Question: 24
Question: 25
Ans: B
Question: 26
(A) stdio.h
(B) conio.h
(C) stdlib.h
(D) stdlibio.h
Ans: B
Question: 27
void main()
int A;
A = 10;
printf("%d", A);
}
(A) extern
(B) auto
(C) register
(D) static
Ans: B
Question: 28
(A) Yes
(B) No
(C) Depends on Compiler
(D) Yes but run time error
Ans: B
Question: 29
#include<stdio.h>
int main()
int a = 10;
printf("%d", a);
int a = 20;
printf("%d",a);
return 0;
}
(A) 1020
(B) 1010
(C) 2020
(D) Error: Redeclartion of a
Ans: D
Question: 30
Ans: B