QUIZ ON : C LANGUAGE - INTRODUCTION TO C LANGUAGE

INTRODUCTION TO C LANGUAGE

00:00:00

Which of the following is the correct order of evaluation for the below expression? z = x + y * z / 4 % 2 - 1

Option A. * / % + - =
Option B. = * / % + -
Option C. / * % - + =
Option D. * % / - + =
True Answer A

Explanation :

Which of the following is the correct order of evaluation for the below expression? z = x + y * z / 4 % 2 - 1

Question No# : 01 out of 20



a ‘C’ expression contains relational, assignment and arithmetic operators. There are no parentheses used. They will be evaluated in which of the following order

Option A. Assignment Relational Arithmetic
Option B. Arithmetic Relational Assignment
Option C. Relational Arithmetic Assignment
Option D. Assignment Arithmetic Relational
True Answer B

Explanation :

a ‘C’ expression contains relational, assignment and arithmetic operators. There are no parentheses used. They will be evaluated in which of the following order

Question No# : 02 out of 20



Are the expression *ptr++ and ++*ptr are same?

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

Explanation :
*ptr++ increments the pointer and not the value, whereas the ++*ptr increments the value being pointed by ptr

Are the expression *ptr++ and ++*ptr are same?

Question No# : 03 out of 20

Which is correct with respect to the size of the data types?

Option A. char > int > float
Option B. int > char > float
Option C. char < int < double
Option D. double > char > int
True Answer C

Explanation :
char has less bytes than int and int has less bytes than double in any system

Which is correct with respect to the size of the data types?

Question No# : 04 out of 20



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

Option A. infomax
Option B. info_max
Option C. info max
Option D. All of these
True Answer C

Explanation :

No special characters, such as semicolon, period, whitespaces, slash or comma are permitted to be used in or as Identifier.

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

Question No# : 05 out of 20



Standard ANSI C recognizes ______ number of keywords?

Option A. 30
Option B. 32
Option C. 36
Option D. 40
True Answer B

Explanation :

Standard ANSI C recognizes ______ number of keywords?

Question No# : 06 out of 20



In an assignment statement a=b; which of the following statement is true?

Option A. it Compare the variable a and the variable b are same.
Option B. The value of b is assigned to variable a but if b changes later, it will not effect the value of variable a.
Option C. The value of b is assigned to variable a but if b changes later, it will effect the value of variable a.
Option D. The value of variable a is assigned to variable b, and the value of variable b is assigned to variable a.
True Answer B

Explanation :

In an assignment statement a=b; which of the following statement is true?

Question No# : 07 out of 20



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

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

Explanation :

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

Question No# : 08 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# : 09 out of 20

What will be output if you compile and execute the following ‘C’ code?

void main(){
	int i=4,x;
	x=++i + ++i + ++i;
	printf("%d",x);
}

Option A. 21
Option B. 18
Option C. 19
Option D. Compilation error
True Answer C

Explanation :

What will be output if you compile and execute the following ‘C’ code?

void main(){
	int i=4,x;
	x=++i + ++i + ++i;
	printf("%d",x);
}

Question No# : 10 out of 20



Which of the following can be used as a variable name?

Option A. no of students
Option B. char
Option C. 7th
Option D. myName
True Answer D

Explanation :

Which of the following can be used as a variable name?

Question No# : 11 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# : 12 out of 20



What is the size of an int data type?

Option A. 4 Bytes
Option B. 8 Bytes
Option C. Depends on the system/compiler
Option D. Cannot be determined
True Answer C

Explanation :
The size of the data types depend on the system.

What is the size of an int data type?

Question No# : 13 out of 20



What is the correct value to return to the operating system upon the successful completion of a program?

Option A. 1
Option B. -1
Option C. 0
Option D. 2
True Answer C

Explanation :

What is the correct value to return to the operating system upon the successful completion of a program?

Question No# : 14 out of 20



3 += 3; evaluates to 6.

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

Explanation :

3 += 3; evaluates to 6.

Question No# : 15 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# : 16 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# : 17 out of 20



A preprocessor directive is a message from compiler to the linker.

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

Explanation :
A preprocessor directive is a message from compiler to a linker. When the preprocessor encounters #define directive, it replaces any occurrence of symbol in the rest of the code by replacement

A preprocessor directive is a message from compiler to the linker.

Question No# : 18 out of 20

What is short int in C programming?

Option A. Basic datatype of C
Option B. Qualifier
Option C. Short is the qualifier and int is the basic datatype
Option D. All of the mentioned
True Answer C

Explanation :

What is short int in C programming?

Question No# : 19 out of 20



The && and | | operators

Option A. compare two numeric values
Option B. combine two numeric values
Option C. compare two boolean values
Option D. None of the above
True Answer C

Explanation :

The && and | | operators

Question No# : 20 out of 20