QUIZ ON : C LANGUAGE - INTRODUCTION TO C LANGUAGE

INTRODUCTION TO C LANGUAGE

00:00:00

By default a real number is treated as a

Option A. float
Option B. double
Option C. long double
Option D. far double
True Answer B

Explanation :
In computing, 'real number' often refers to non-complex floating-point numbers. It include both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265... When the accuracy of the floating point number is insufficient, we can use the double to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float. To extend the precision further we can use long double which occupies 10 bytes of memory space.

By default a real number is treated as a

Question No# : 01 out of 20



A printf statement can be used to display output on different lines.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

A printf statement can be used to display output on different lines.

Question No# : 02 out of 20

Which of the following cannot be a variable name in C?

Option A. volatile
Option B. true
Option C. friend
Option D. export
True Answer A

Explanation :
volatile is C keyword.

Which of the following cannot be a variable name in C?

Question No# : 03 out of 20



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

Option A. int number;
Option B. float rate;
Option C. int variable_count;
Option D. int $main;
True Answer D

Explanation :
Since only underscore and no other special character is allowed in a variable name, it results in an error

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

Question No# : 04 out of 20



The result of a Relational operation is always

Option A. Either True or False
Option B. is less than or is more than
Option C. is equal or less or more
Option D. All of the above
True Answer A

Explanation :

Relational operators always yield a TRUE or FALSE result. Remember that a TRUE result evaluates to any non-zero value (often 1), while a FALSE result evaluates only to zero. Relational operators have a lower precedence than the arithmetic operators.

The result of a Relational operation is always

Question No# : 05 out of 20



# is used to insert comments in the program.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

# is used to insert comments in the program.

Question No# : 06 out of 20

In the expression a=b=5 the order of Assignment is NOT decided by Associativity of operators.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

In the expression a=b=5 the order of Assignment is NOT decided by Associativity of operators.

Question No# : 07 out of 20

What is short int in C programming?

Option A. The basic data type of C
Option B. Qualifier
Option C. Short is the qualifier and int is the basic data type
Option D. All of the mentioned
True Answer C

Explanation :

What is short int in C programming?

Question No# : 08 out of 20



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

Option A. int number
Option B. float rate
Option C. int variable_count
Option D. int $main
True Answer D

Explanation :
Since only underscore and no other special character is allowed in a variable name, it results in an error.

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

Question No# : 09 out of 20



Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

Option A. rem = 3.14 % 2.1;
Option B. rem = modf(3.14, 2.1);
Option C. rem = fmod(3.14, 2.1);
Option D. Remainder cannot be obtain in floating point division.
True Answer C

Explanation :
fmod(x,y) - Calculates x modulo y, the remainder of x/y. This function is the same as the modulus operator. But fmod() performs floating point divisions.

Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

Question No# : 10 out of 20



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

Option A. float PI = 3.14;
Option B. double PI = 3.14;
Option C. int PI = 3.14;
Option D. #define PI 3.14
True Answer D

Explanation :
#define PI 3.14 is a macro preprocessor, it is a textual substitution.

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

Question No# : 11 out of 20



A variable is a string that varies during program execution.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

A variable is a string that varies during program execution.

Question No# : 12 out of 20

Which one is incorrect statement for C Language?

Option A. C compiler supports octal integer constant.
Option B. C compiler supports hexadecimal integer constant.
Option C. C compiler supports binary integer constant.
Option D. C compiler supports decimal integer constant.
True Answer D

Explanation :

Which one is incorrect statement for C Language?

Question No# : 13 out of 20



which Input function does not show the character read from the input device

Option A. scanf()
Option B. getch()
Option C. getche()
Option D. gets()
True Answer B

Explanation :

Getch() function is need to be used in some c compilers like turbo c. Getch is used to hold the output sceen and wait until user gives any type of input(i.e. Until user press any key ) so that they can read the character and due to this we able to see the output on the screen.

which Input function does not show the character read from the input device

Question No# : 14 out of 20



If i = 8 and j = 5 are two integers, then the value of (i>0) || (j < 5) is

Option A. -5
Option B. 1
Option C. 0
Option D. +5
True Answer B

Explanation :

If i = 8 and j = 5 are two integers, then the value of (i>0) || (j < 5) is

Question No# : 15 out of 20



sizeof( ) is a function that returns the size of a variable.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

sizeof( ) is a function that returns the size of a variable.

Question No# : 16 out of 20

Function isdigit() is defined in ________ header file.

Option A. ctype.h
Option B. stdio.h
Option C. conio.h
Option D. math.h
True Answer A

Explanation :

Function isdigit() is defined in ________ header file.

Question No# : 17 out of 20



Which of the following cannot be used in identifiers?

Option A. Spaces
Option B. Digits
Option C. Underscores
Option D. Letters
True Answer A

Explanation :

An Identifier can only have alphanumeric characters(a-z , A-Z , 0-9) and underscore( _ ). The first character of an identifier can only contain alphabet(a-z , A-Z) or underscore ( _ ). Identifiers are also case sensitive in C. For example name and Name are two different identifiers in C.

Which of the following cannot be used in identifiers?

Question No# : 18 out of 20



If a is an integer variable, then a = 5/2 will return a value

Option A. 2.5
Option B. 2
Option C. 2.000000
Option D. 2.500000
True Answer B

Explanation :

If a is an integer variable, then a = 5/2 will return a value

Question No# : 19 out of 20



#define is used to define symbolic constant.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

#define is used to define symbolic constant.

Question No# : 20 out of 20