wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

14 Sep_2022 Technical quiz

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Recognize the name of person

a)

Steve Jobs

b)

James Gosling

c)

Dennis Ritchie

d)

Rasmus Lerdorf

2.

What is the 16-bit compiler allowable range for integer constants?

a)

-3.4e38 to 3.4e38

b)

-32767 to 32768

c)

-32668 to 32667

d)

-32768 to 32767

3.

main()  

{printf("G L Bajaj");  

main();} 

a)

Wrong statement

b)

It will keep on printing G L Bajaj

c)

It will Print G L Bajaj once

d)

None of the these

4.

Which of the following is not a valid C variable name?

a)

int number;

b)

float rate;

c)

int variable_count;

d)

int $main;

5.

All keywords in C are in ____________

a)

LowerCase letters

b)

UpperCase letters

c)

CamelCase letters

d)

None of the mentioned

6.

main()

{  

  int i = 2;  

  {  

    int i = 4, j = 5;  

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

  }    

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

}  

a)

4525

b)

2525

c)

4545

d)

None of the these

7.

What is the output of this statement "printf("%d", (a++))"?

a)

The value of (a + 1)

b)

The current value of a

c)

Error message

d)

Garbage

8.

main()  

{  

  int a = 1, b = 2, c = 3:  

  printf("%d", a + = (a + = 3, 5, a));  

}  

a)

6

b)

9

c)

12

d)

8

9.

Why is a macro used in place of a function?

a)

It reduces execution time.

b)

It reduces code size.

c)

It increases execution time.

d)

It increases code size.

10.

How many times will the following loop execute?

for(j = 1; j <= 10; j = j-1)  

a)

Forever

b)

Never

c)

0

d)

1

11.

Which one of the following is a loop construct that will always be executed once?

a)

for

b)

while

c)

switch

d)

do while

12.

Directives are translated by the

a)

Pre-processor

b)

Compiler

c)

Linker

d)

Editor

13.

Which of the following is NOT possible with any 2 operators in C?

a)

Different precedence, same associativity

b)

Different precedence, different associativity

c)

Same precedence, different associativity

d)

All of the mentioned

14.

What is #include <stdio.h>?

a)

Preprocessor directive

b)

Inclusion directive

c)

File inclusion directive

d)

None of the mentioned

15.

scanf() is a predefined function in______header file.

a)

stdlib. h

b)

ctype. h

c)

stdio. h

d)

stdarg. h

16.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int y = 10000;

int y = 34;

printf("Hello World! %d\n", y);

return 0;

}

a)

Compile time error

b)

Hello World! 34

c)

Hello World! 1000

d)

Hello World! followed by a junk value

17.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

signed char chr;

chr = 128;

printf("%d\n", chr);

return 0;

}

a)

128

b)

-128

c)

Depends on the compiler

d)

None of the mentioned

18.

#include <stdio.h>

// Assume base address of "GeeksQuiz" to be 1000

int main()

{

   printf(5 + "MCA Department");

   return 0;

}

a)

MCA Department

b)

Department

c)

1005

d)

Compile time error

19.

In C, parameters are always 

a)

Passed by value

b)

Passed by reference

c)

Non-pointer variables are passed by value and pointers are passed by reference

d)

Passed by value result

20.

Which of the following is not a storage class specifier in C?

a)

auto

b)

register

c)

static

d)

volatile

21.

Study the following program:

main()  

{  

   char x [10], *ptr = x;  

  scanf ("%s", x);  

  change(&x[4]);  

}  

 change(char a[])  

 {  

   puts(a);  

 }  

If abcdefg is the input, the output will be

a)

abcd

b)

abc

c)

efg

d)

Garbage

22.

How many characters can a string hold when declared as follows?

char name[20]:  

a)

18

b)

19

c)

20

d)

None of the these

23.

What will the result of num1 variable after execution of the following statements?

int j = 1, num1 = 4;  

while (++j <= 10)  

{  

  num1++;  

}  

a)

11

b)

12

c)

13

d)

14

24.

Which of the following is true for variable names in C?

a)

They can contain alphanumeric characters as well as special characters

b)

It is not an error to declare a variable to be one of the keywords(like goto, static)

c)

Variable names cannot start with a digit

d)

Variable can be of any length

25.

What is the result of logical or relational expression in C?

a)

True or False

b)

0 or 1

c)

0 if an expression is false and any positive number if an expression is true

d)

None of the mentioned

26.

Functions in C Language are always _________

a)

Internal

b)

External

c)

Both Internal and External

d)

External and Internal are not valid terms for functions

27.

If addition had higher precedence than multiplication, then the value of the expression (1 + 2 3 + 4 * 5) would be which of the following?

a)

27

b)

47

c)

69

d)

105

28.

What will be the output of this program?

int main()      

{      

int a=10, b=20;        

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

a=a+b;      

b=a-b;      

a=a-b;      

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

return 0;    

}     

a)

a = 20, b = 20

b)

a = 10, b = 20

c)

a = 20, b = 10

d)

a = 10, b = 10

29.

The following statements are about EOF. Which of them is true?

a)

Its value is defined within stdio.h

b)

Its value is implementation dependent

c)

Its value can be negative

d)

All of the these

30.

What does this statement mean?

x - = y + 1;  

a)

x = x - y + 1

b)

x = -x - y - 1

c)

x = x + y - 1

d)

x = x - y - 1

31.

Study the following array definition

int num[10] = {3, 3, 3};  

Which of the following statement is correct?

a)

num[9] is the last element of the array num

b)

The value of num[8] is 3

c)

The value of num[3] is 3

d)

None of the above

32.

What will the output after execution of the following statements?

void main()  

{  

  int i = 065, j = 65;  

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

}  

a)

065,65

b)

53,65

c)

65,65

d)

Syntax error

33.

Array is a _________ data structure.

a)

Non-linear

b)

Primary

c)

Linear

d)

Data type

34.

Which of the following statement is correct about the C language?

a)

The C language is a binary language with some extra features.

b)

The C language is a high-level language with some low features.

c)

The C language is a mid-level language with some high features.

d)

The C language is a low-level language.

35.

Study the following statement

printf ("%d", 9/5);  

a)

1.8

b)

1.0

c)

2.0

d)

None of the these

36.

Who defines the user-defined function?

a)

Compiler

b)

Computer

c)

Compiler Library

d)

Users

37.

Which of the following operations cannot be performed in file handling?

a)

Open the file

b)

Read the file

c)

To write a file

d)

None of the these

38.

In which of the following modes, the user can read and write the file?

a)

r

b)

w

c)

r+

d)

b+

39.

Which of the following operator's precedence order is correct (from highest to lowest)?

a)

%, *, /, +, -

b)

%, +, /, *, -

c)

+, -, %, *, /

d)

%, +, -, *, /

40.

Study the following program:

main ()  

{  

  if(5 < '5')  

        printf("5")  

  else  

        printf("Not equal to 5.")  

}  

What will be the output of this program?

a)

ENQ

b)

5

c)

I

d)

Not equal to 5

41.

What is the output of this code?

main() {

            int y=3;

            if(y & (y=8) ^ 9)

                printf("true %d\n",y);

            else

                printf("false %d\n",y);

}

a)

true 8

b)

false 8

c)

true 9

d)

false 9

42.

What is output?

main()

    {

        if (!(((~0 == 1) || 1&2 || 0)))

            if(!0 || !1==0)

                printf("yes\n");

            else

                printf("Hello\n");

        else

            printf("no\n");

    }

a)

yes

b)

Hello

c)

no

d)

None of the these

43.

What is output?

main() {

   int x = 8;

        x = x << 2;

        printf("%d\n", x);

a)

32

b)

64

c)

128

d)

256

44.

What will be output?

main() {

    int x=1,y=1;

    while ( x++ < 3 && x + y < 5);

    printf("%d",x);

}

a)

4

b)

7

c)

5

d)

3

45.

What will be the output?

main()

    {

        int x = 6;

        int *p = &x;

        int *k = p++;

        int r = p - k;

        printf("%d", r);

    }

a)

1

b)

3

c)

6

d)

4

46.

Observe this image and tell, how quickly we can reach end of each path?

a)

BFS

b)

DFS

c)

Stack

d)

None of the these

47.

First operating system designed using C programming language.

a)

DOS

b)

Windows

c)

Unix

d)

Mac

48.

If the function returns no value then it is called ____

a)

Data type function

b)

Calling function

c)

Main function

d)

Void function

49.

C Language is a successor to which language.?

a)

FORTRAN

b)

D Language

c)

BASIC

d)

B Language

50.

What is the present C Language Standard.?

a)

C99 ISO/IEC 9899:1999

b)

C11 ISO/IEC 9899:2011

c)

C05 ISO/IEC 9899:2005

d)

C10 ISO/IEC 9899:2010