wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Orientation Quiz

Total questions: 50

Worksheet time: 36mins

Name
Class
Date
1.

Is it possible to run program without main() function?

a)

Yes

b)

No

2.

How many main() function we can have in our project?

a)

1

b)

2

c)

No Limits

d)

Depends on Compiler

3.

What is sizeof() in C?

a)

Operator

b)

Fuction

c)

Macro

d)

None of these

4.

Is it true that a function may have several declaration, but only one definition.

a)

Yes

b)

No

5.

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

6.

int main()

{


char *ptr1, *ptr2;

printf("%d %d", sizeof(ptr1), sizeof(ptr2));


return 0;

}

a)

1 1

b)

2 2

c)

4 4

d)

Undefined

7.

Which programming language is more faster among these?

a)

Java

b)

C

c)

Visual Basic

d)

PHP

8.

void main()

{

int a = printf ("CppBuzz.com");

printf("%d", a);

}

a)

Compilation error

b)

CppBuzz.com

c)

0

d)

CppBuzz.com11

9.

Which of the following is executed by Preprocess?

a)

#include<stdio.h>

b)

return 0

c)

int main (int argc,char** argv)

d)

None of above

10.

int main()

{

int _ = 10;

int __ = 20;

int ___ = _ + __;

printf("__%d",___);

return 0;

}

a)

Compilation error

b)

Runtime error

c)

__0

d)

__30

11.

int main()

{

int a = 5;

int b = 10;

int c = a+b;

printf("%i",c);

}

a)

0

b)

15

c)

Undefined i

d)

Any other compilation error

12.

int main()

{

char arr[5]="The CppBuzz.com";

printf("%s",arr);

return 0;

}

a)

The CppBuzz.com

b)

The C

c)

The CppBuzz

d)

Compilation error

13.

How many times CppBuzz.com is printed?

void main()

{

int a = 0;

while(a++ < 5-++a)

printf("CppBuzz.com");

}

a)

5 Times

b)

1 Times

c)

2 Times

d)

4 Times

14.

#include <stdio.h>

int main()

{

if(printf("C programming is "))

{

printf("Easy");

}

else

{

printf("Hard");

}


return 0;

}

a)

Easy

b)

Hard

c)

C programming is Easy

d)

None of the above

15.

What is the job of Assembler in C programming?

a)

It converts source code into assembly code

b)

It converts a assembly language program into machine language

c)

It convert code generated by Preprocessor to assembly code

d)

None of the above

16.

Will compiler produce any compilation error if same header file is included two times?

a)

No

b)

Yes

17.

What should be the output of below program?


#define # @

@include <stdio.h>


int main()

{

printf("CppBuzz.com");

return 0;

}

a)

CppBuzz.com

b)

Nothing

c)

Compilation error

d)

Depends on compiler

18.

Does this program get compiled successfully?


#include stdio.h


int main()

{

printf("CppBuzz.com");

return 0;

}

a)

Depends on Compiler

b)

Yes

c)

No

19.

Which one of the following is invalid macro in C programming?

a)

#pragma

b)

#error

c)

#ifndef

d)

#elseif

20.

__FILE__ is predefined macro and contains the current filename as a string. Is this true/false?

a)

Yes

b)

No

21.

What is the extension of output file produced by Preprocessor?

a)

.h

b)

.exe

c)

.i

d)

.asm

22.

Is there any limit in adding no of header files in program?

a)

Yes

b)

No

23.

Which compilation unit is responsible for adding header files content in the source code?

a)

Linker

b)

Compiler

c)

Assembler

d)

Preprocesor

24.

In compilation process at what sequence Preprocessor comes into picture?

a)

1

b)

2

c)

3

d)

4

25.

Is it possible to write C program which it print self?

a)

Yes

b)

No

26.

I'm Developer of C programming language.

a)

Ken Thompson

b)

Brian Kernighan

c)

Dennis Ritchie

d)

Bjarne Stroustrup

27.

I made the first complete Compiler. It also Known as FORTRAN.

a)

John Backus

b)

David A. Badar

c)

Tim Berners - Lee

d)

Gordon Bell

28.

I am inventor of WWW (World Wide Web).

a)

Steven M. Bellovin

b)

Tim Berners-Lee

c)

Peter Bernus

d)

Manuel Blum

29.

I am the father of RISC architecture.

a)

Edgar F. Codd

b)

Stephen Cook

c)

Danese Cooper

d)

John Cocke

30.

I am the Developer of Node.js Javascript Runtime.

a)

Isaac Z.schlueter

b)

Jeff Dean

c)

Ryan Dahi

d)

Tom DeMarco

31.

C Language developed at _____________?

a)

AT & T's Bell Laboratories of USA in 1972

b)

AT & T's Bell Laboratories of USA in 1970

c)

Sun Microsystems in 1973

d)

Cambridge University in 1972

32.

C was primarily developed as

a)

General purpose language

b)

Data processing language

c)

System programming language

d)

None of the above.

33.

Standard ANSI C recognizes ________ number of keywords.

a)

30

b)

32

c)

40

d)

24

34.

Which one of the following is not a reserved keyword for C?

a)

auto

b)

default

c)

register

d)

main

35.

A C variable cannot starts with

a)

An alphabet

b)

Both of the below

c)

A special character other than underscore

d)

A numbet

36.

What will be printed after execution of the following program code.


main(){


printf("\\nab");

printf("\\bsi");

printf("\\rha");


}

a)

absiha

b)

asiha

c)

haasi

d)

hai

e)

None of the above

37.

Which of the following is not a correct variable type?

a)

float

b)

real

c)

int

d)

double

38.

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);

a)

8

b)

7

c)

6

d)

5

39.

Find the output of the following program.

void main()

{


int i=01289;

printf("%d", i);


}

a)

0289

b)

1289

c)

713

d)

syntax error

40.

Find the output of the following program.


void main()

{

int i=065, j=65;

printf("%d %d", i, j);

}

a)

53 65

b)

65 65

c)

053 65

d)

065 65

41.

I'm inventor of Tesla tower.

a)

Elon Musk

b)

Marc Tarpenning

c)

Nikola Tesla

d)

Martin Eberhard

42.

I invented Dijkstra's algorithm.

a)

Rutger Dijkstra

b)

Edsger Dijkstra

c)

Marcus Dijkstra

d)

William Dijkstra

43.

We are the co - founder of Google.

a)
b)
c)
d)
44.

If ASCII value of 'x' is 120, then what is the value of the H, if


H = ('x' – 'w' ) / 3;

a)

0

b)

1

c)

2

d)

3

45.

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?

a)

24

b)

7

c)

6

d)

12

46.

Many features of C were derived from an earlier language called _____.

a)

B

b)

BASIC

c)

BCPL

d)

FORTRAN

47.

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;

}

a)

2,2,2

b)

0,2,2

c)

0,1,2

d)

1,1,2

48.

#include <stdio.h>

void main()

{


int a = 3;


int b = ++a + a++ + --a;


printf("Value of b is %d", b);


}

a)

Value of x is 12.

b)

Value of x is 10.

c)

Value of x is 13.

d)

Undefined behavior

49.

What is the precedence of arithmetic operators (from highest to lowest)?

a)

%, *, /, +, –

b)

%, +, /, *, –

c)

+, -, %, *, /

d)

%, +, -, *, /

50.

Which of the following is not an arithmetic operation?

a)

a *= 10;

b)

a /= 10;

c)

a != 10;

d)

a %= 10;