wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Language Test

Total questions: 35

Worksheet time: 25mins

Name
Class
Date
1.

C is a ___.

a)

Low level language

b)

High level language

c)

Medium level language

d)

None of the above

2.

How many keywords are there in C language?

a)

32

b)

33

c)

64

d)

18

3.

C language is a ___.

a)

Procedural oriented programming language

b)

General purpose programming language

c)

Structured programming

d)

All of the above

4.

In which version of C language, the C++ Style comment (//) are introduced?

a)

C17

b)

C18

c)

C89

d)

C99

5.

The C source file is processed by the ___.

a)

Interpreter

b)

Compiler

c)

Both Interpreter and Compiler

d)

Assembler

6.

Who is known as the father of C language?

                 

a)

James A Gosling  

b)

Dennis Ritchie

c)

Bjarne Stroustrup

d)

E F Codd

7.

C language was initialized in the year?

                                                                    

a)

1976    

b)

1972

c)

1970

d)

1974

8.

In printf, f stands for?

                                                             

a)

Formater 

b)

format

c)

file

d)

file format

9.

in C language, # refers to?

a)

Symbol 

b)

Processor

c)

Post processor  

d)

  Pre Processor

10.

Printf is which type of function?

a)

Pre-defined output

b)

user-defined output 

c)

output 

d)

pre-defined input

11.

What is the output of this code?

char ch;

ch=A;

printf(“%c”,ch);                       

a)

A

b)

97

c)

65

d)

garbage value

12.

What is the output of the following code

int a=33,b;

b=(a++)-(--a);

printf("%d",b);                        

 

a)

33

b)

-33

c)

0

d)

garbage value

13.

After Compilation and execution how many files was created in C Language

a)

1

b)

4

c)

3

d)

2

14.

what is scanf function?

a)

Input

b)

output  

c)

abstract  

d)

abstract input

15.

>> is which operator?

                                                           

a)

Relational

b)

logical

c)

bitwise

d)

arithmetic

16.

Which of the following is an invalid assignment operator?

                                                                                             

a)

A%=10; 

b)

  A/=10; 

c)

A|=10   

d)

none

17.

C Language is 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

18.

int main ()

{

int x = 24, y = 39, z = 45;

z = x + y;

y = z - y;

x = z - y;

printf ("%d %d %d", x, y, z);

}

                                           

a)

24 36 63

b)

39 24 63

c)

24 39 45

d)

39 24 45

19.

What punctuation is used to indicate the beginning and end of code blocks?

a)

{}

b)

><

c)

  BEGIN and END    

d)

(and)

20.

C is a ____________ programming language

a)

Object oriented Programming

b)

Procedure oriented Programming

c)

Structured programming language

d)

Structure and Procedure Oriented Programming

21.

. _______________to be included to use standard I/O functions : prinf(),scanf()

a)

#include<conio.h>

b)

#include<stdio.h>

c)

#include<string.h>

d)

#include<math.h>

22.

Which is correct example for variable declaration?

                     

a)

int a;b;c;

b)

Int a,b,c; 

c)

int a,b,c;

d)

int a,b;c;

23.

Every C statement ends with ------------?

a)

.

b)

;

c)

,

d)

}

24.

What is the extension of C program?

                                            

a)

.cpp  

b)

.py

c)

.c

d)

.java

25.

A sequence of instructions form a ------------.

                                    

a)

Syntax

b)

program

c)

both

d)

none of these

26.

What is correct variable rules in C Language

1. A variable will contain numbers

2. A variable must have underscore

3. A variable will not allow special characters

             

a)

Both 1&2 follows

b)

Both 1&3 follows

c)

All 1,2&3 follows

d)

Both2&3 follows

27.

What is the correct statement by the following

1. # refers to a preprocessor

2. # will not executes a set of statements before main program executes

3. # allows you to create a macros

a)

Both 1 & 2 follows

b)

Both 1 & 3 follows

c)

All 1, 2 & 3 follows

d)

Both 2 & 3 follows

28.

What is the correct statement by the following

In “scanf” & refers to

1.) Address of a memory location

2.) Operator refers to Address

3.) Syntax for scanning a Variable

4.) All the above

a)

Only 1&2 follows 

b)

Both 1&3 follows

c)

Only 3 follows 

d)

Only 1 follows

29.

What is the output of the following code

#include<stdio.h>

void main()

{

         int a,b,c,d;

         a=23;

         b=(a--)+(a++);

         c=(b--)+(--a);

         d=(a+b)-(c—);

        printf(“%d%d%d%d”,a,b,c,d);

}

a)

224567-1

b)

234760-2

c)

224667-1 

d)

234667-1

30.

What is the output of the following code

#include<stdio.h>

void main()

{

         int a,*p;

         a=23;

         p=&a;

         *p=92;

         printf(“%d”,++*p);

}

a)

23

b)

93 

c)

Compile Time Error

d)

Runtime Error

31.

What is the output of the following code

#include<stdio.h>

void fun()

{

       int x=9;

       printf(“%d ”,x++);

}

void main()

{

         fun();

         fun();

         fun();

}

a)

10 10 10

b)

10 11 12

c)

9 9 9

d)

9 10 11

32.

What is the output of the following code

#include<stdio.h>

enum COLOR {RED=101,GREEN,YELLOW};

typedef enum COLOR color;

void main()

{

   color c;

   clrscr();

   c=GREEN;

   printf("%d",(++c)+(c--));

   getch();

}

a)

204

b)

106

c)

206

d)

104

33.

What is the output of the following code

#include<stdio.h>

union MyUnion

{    char c[8];    int a,b;    float f;

};

typedef union MyUnion MU;

void main()

{

   MU u;

   clrscr();

   printf("%d",sizeof(u));

   getch();

}

a)

8

b)

Compile Error

c)

4

d)

Garbage Value

34.

What is the output of the following code

#include<stdio.h>

void swap(int p,int q)

{

      int temp;

      temp=*p;

      p=q;

       *q=temp;

}

void main()

{

   int a=10,b=22;

   clrscr();

   swap(&a,&b);

   printf("%d%d",a,b);

   getch();

}

a)

10 22

b)

Compile Error

c)

22 10

d)

Garbage Value

35.

What is the output of the following code

#include<stdio.h>

void fun()

{

      int a;

      printf("%d",a);

      a++; 

}

void main()

{

   clrscr();

   fun();

   fun();

   fun();

   getch();

}

a)

Same Garbage Value Three times

b)

Compile Error

c)

Different Garbage Value Three times 

d)

Garbage Value