Home » C Fundamental Test 1

C Fundamental Test 1

by Online Tutorials Library

C Fundamental Test 1


1) Which of the following is the first operating system developed using C programming language?

  1. Windows
  2. DOS
  3. Mac
  4. UNIX

The correct option is (d).

Explanation:

C programming language is invented for developing an operating system called UNIX. By 1973, the complete UNIX OS is developed using C.

2) The C compiler used for UNIX operating system is

  1. cc
  2. gcc
  3. vc++
  4. Borland

The correct option is (a).

Explanation:

Compiler used for UNIX is ‘cc’ their full form is C compiler. gcc is compiler for linux. Borland and vc++ is compiler for windows.

3) Which of the following is a logical AND operator?

  1. ||
  2. !
  3. &&
  4. None of the above

The correct option is (c).

Explanation:

The && is called logical AND operator. If both operands are non-zero, then the condition becomes true.

The || is called logical OR operator. If any of the two operands are non-zero, then the condition becomes true.

The ! is called logical NOT operator. It is used for reversing the logic state of its operand.

4) Which format specifier is used for printing double value?

  1. %Lf
  2. %L
  3. %lf
  4. None of the above

The correct option is (c).

Explanation:

The %lf format specifier is used for printing the double value in a C program.

5) Which of the following statement is used to free the allocated memory space for a program?

  1. vanish(var-name);
  2. remove(var-name);
  3. erase(var-name);
  4. free(var-name);

The correct option is (d).

Explanation:

The memory allocated by malloc(), calloc(), or realloc() function is deallocated by using the library function free(var-name).

You may also like