Font size
WorksheetsOrientation Quiz
Total questions: 50
Worksheet time: 36mins
Is it possible to run program without main() function?
Yes
No
How many main() function we can have in our project?
1
2
No Limits
Depends on Compiler
What is sizeof() in C?
Operator
Fuction
Macro
None of these
Is it true that a function may have several declaration, but only one definition.
Yes
No
int main(){
extern int i;
i = 20;
printf("%d", sizeof(i));
return 0;
}
20
0
Undefined reference to i
Linking error
int main()
{
char *ptr1, *ptr2;
printf("%d %d", sizeof(ptr1), sizeof(ptr2));
return 0;
}
1 1
2 2
4 4
Undefined
Which programming language is more faster among these?
Java
C
Visual Basic
PHP
void main()
{
int a = printf ("CppBuzz.com");
printf("%d", a);
}
Compilation error
CppBuzz.com
0
CppBuzz.com11
Which of the following is executed by Preprocess?
#include<stdio.h>
return 0
int main (int argc,char** argv)
None of above
int main()
{
int _ = 10;
int __ = 20;
int ___ = _ + __;
printf("__%d",___);
return 0;
}
Compilation error
Runtime error
__0
__30
int main()
{
int a = 5;
int b = 10;
int c = a+b;
printf("%i",c);
}
0
15
Undefined i
Any other compilation error
int main()
{
char arr[5]="The CppBuzz.com";
printf("%s",arr);
return 0;
}
The CppBuzz.com
The C
The CppBuzz
Compilation error
How many times CppBuzz.com is printed?
void main()
{
int a = 0;
while(a++ < 5-++a)
printf("CppBuzz.com");
}
5 Times
1 Times
2 Times
4 Times
#include <stdio.h>
int main()
{
if(printf("C programming is "))
{
printf("Easy");
}
else
{
printf("Hard");
}
return 0;
}
Easy
Hard
C programming is Easy
None of the above
What is the job of Assembler in C programming?
It converts source code into assembly code
It converts a assembly language program into machine language
It convert code generated by Preprocessor to assembly code
None of the above
Will compiler produce any compilation error if same header file is included two times?
No
Yes
What should be the output of below program?
#define # @
@include <stdio.h>
int main()
{
printf("CppBuzz.com");
return 0;
}
CppBuzz.com
Nothing
Compilation error
Depends on compiler
Does this program get compiled successfully?
#include stdio.h
int main()
{
printf("CppBuzz.com");
return 0;
}
Depends on Compiler
Yes
No
Which one of the following is invalid macro in C programming?
#pragma
#error
#ifndef
#elseif
__FILE__ is predefined macro and contains the current filename as a string. Is this true/false?
Yes
No
What is the extension of output file produced by Preprocessor?
.h
.exe
.i
.asm
Is there any limit in adding no of header files in program?
Yes
No
Which compilation unit is responsible for adding header files content in the source code?
Linker
Compiler
Assembler
Preprocesor
In compilation process at what sequence Preprocessor comes into picture?
1
2
3
4
Is it possible to write C program which it print self?
Yes
No
I'm Developer of C programming language.
Ken Thompson
Brian Kernighan
Dennis Ritchie
Bjarne Stroustrup
I made the first complete Compiler. It also Known as FORTRAN.
John Backus
David A. Badar
Tim Berners - Lee
Gordon Bell
I am inventor of WWW (World Wide Web).
Steven M. Bellovin
Tim Berners-Lee
Peter Bernus
Manuel Blum
I am the father of RISC architecture.
Edgar F. Codd
Stephen Cook
Danese Cooper
John Cocke
I am the Developer of Node.js Javascript Runtime.
Isaac Z.schlueter
Jeff Dean
Ryan Dahi
Tom DeMarco
C Language developed at _____________?
AT & T's Bell Laboratories of USA in 1972
AT & T's Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
C was primarily developed as
General purpose language
Data processing language
System programming language
None of the above.
Standard ANSI C recognizes ________ number of keywords.
30
32
40
24
Which one of the following is not a reserved keyword for C?
auto
default
register
main
A C variable cannot starts with
An alphabet
Both of the below
A special character other than underscore
A numbet
What will be printed after execution of the following program code.
main(){
printf("\\nab");
printf("\\bsi");
printf("\\rha");
}
absiha
asiha
haasi
hai
None of the above
Which of the following is not a correct variable type?
float
real
int
double
What number would be shown on the screen after the following statements of C are executed?
char ch;
int i;
ch = 'G';
i = ch-'A';
printf("%d", i);
8
7
6
5
Find the output of the following program.
void main()
{
int i=01289;
printf("%d", i);
}
0289
1289
713
syntax error
Find the output of the following program.
void main()
{
int i=065, j=65;
printf("%d %d", i, j);
}
53 65
65 65
053 65
065 65
I'm inventor of Tesla tower.
Elon Musk
Marc Tarpenning
Nikola Tesla
Martin Eberhard
I invented Dijkstra's algorithm.
Rutger Dijkstra
Edsger Dijkstra
Marcus Dijkstra
William Dijkstra
We are the co - founder of Google.
If ASCII value of 'x' is 120, then what is the value of the H, if
H = ('x' – 'w' ) / 3;
0
1
2
3
short testarray[4][3] =
{ {1}, {2,3}, {4,5,6}};
printf("%d", sizeof(testarray));
Assuming a short is two bytes long, what will be printed by the above code?
24
7
6
12
Many features of C were derived from an earlier language called _____.
B
BASIC
BCPL
FORTRAN
Guess the output of the program ?
#include<stdio.h>
int main()
{
int a=0, b=1, c=2;
*((a+1 == 1) ? &b : &a) = a ? b : c;
printf("%d, %d, %d\n", a, b, c);
return 0;
}
2,2,2
0,2,2
0,1,2
1,1,2
#include <stdio.h>
void main()
{
int a = 3;
int b = ++a + a++ + --a;
printf("Value of b is %d", b);
}
Value of x is 12.
Value of x is 10.
Value of x is 13.
Undefined behavior
What is the precedence of arithmetic operators (from highest to lowest)?
%, *, /, +, –
%, +, /, *, –
+, -, %, *, /
%, +, -, *, /
Which of the following is not an arithmetic operation?
a *= 10;
a /= 10;
a != 10;
a %= 10;
