Javatpoint Logo
Javatpoint Logo

C Fundamental Test 2


6) In a library of C programming language, which of the following header file is used for performing mathematical operations?

  1. conio.h
  2. dos.h
  3. math.h
  4. stdio.h

The correct option is (c).

Explanation:

"math.h" is a header file used for performing mathematical operation in a library of C programming language.

7) What are the various types of real data type in C language?

  1. long double, short int
  2. float, long double
  3. short int, double, long int, float
  4. float, double, long double

The correct option is (d).

Explanation:

Floating data type is known as real data type.

There are three types of floating data type:

  • float with storage size of 4 byte
  • long double with storage size of 10 byte
  • double with storage size of 8 byte

8) The statement used for printing \n on the screen is:

  1. printf("");
  2. printf('\n');
  3. printf("\\n");
  4. printf("n\");

The correct option is (c).

Explanation:

In C language,"\n" is the escape sequence for printing a new line character. For a statement printf("\\n"); statement , "\\" symbol will be printed as "\" and "n" is known as a common symbol.

9) Which of the following are declarations?

  1. float square (float x){?}
  2. double pow(double, double);
  3. extern int x;

Options are given below:

  1. 1
  2. 1 and 3
  3. 2
  4. 1 and 2

The correct option is (b).

Explanation:

double pow(double, double); instruction is a function prototype declaration

extern int x; instruction is an external variable declaration.

Therefore 1 and 3 are declarations and 2 is definition.

10) Which header file is used to define input/output functions, macros and prototypes?

  1. memory.h
  2. math.h
  3. dos.h
  4. stdio.h

The correct option is (d).

Explanation:

Header file stdio.h is used for defining the macros, variable and various functions for performing input and output operation in C-language.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA