wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Module 1_Introduction to C Programming

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

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

a)

int number

b)

float rate

c)

int variable_count

d)

int $main

2.

What is #include <stdio.h>?

a)

Preprocessor directive

b)

Inclusion directive

c)

File inclusion directive

d)

None of the mentioned

3.

What is the sizeof(char) in a 32-bit C compiler?

a)

1 bit

b)

2 bits

c)

1 Byte

d)

2 Bytes

4.

scanf() is a predefined function in______header file.

a)

stdlib. h

b)

ctype. h

c)

stdio. h

d)

stdarg. h

5.
  1. #include <stdio.h>

  2. int main()

  3. {

  4. int y = 10000;

  5. int y = 34;

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

  7. return 0;

  8. }

a)

Compile time error

b)

Hello World! 34

c)

Hello World! 1000

d)

Hello World! followed by a junk value

6.
  1. #include <stdio.h>

  2. void main()

  3. {

  4. int x = 5 * 9 / 3 + 9;

  5. }

a)

3.75

b)

Depends on compiler

c)

24

d)

3

7.

How many keywords are there in C Language ?

a)

30

b)

22

c)

32

d)

36

8.

What is the output of this program?

#include <stdio.h>
int main()

{
  int x = 10;
  float x = 10.0;
  printf("%d",x);
  return 0;
}

a)

10.1

b)

Compilations Error

c)

10

d)

10

9.

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

a)

Variable names cannot start with a digit

b)

Variable can be of any length

c)

They can contain alphanumeric characters as well as special characters

d)

Reserved Word can be used as variable name

10.

What is the output of this C code?

#include <stdio.h>
int main()
{
float x = ‘a’;
printf(“%f”, x);
return 0;
}

a)

97.000000

b)

run time error

c)

a.0000000

d)

a