QUIZ ON : C LANGUAGE - INTRODUCTION TO C LANGUAGE

INTRODUCTION TO C LANGUAGE

00:00:00

What will be the output of the following program?

int main() 

int x=5; 
printf(“%d %d %d”,x,x<<2,x>>2); 
}

Option A. 1 20 5
Option B. 5 1 20
Option C. 5 20 1
Option D. 20 1 5
True Answer C

Explanation :

What will be the output of the following program?

int main() 

int x=5; 
printf(“%d %d %d”,x,x<<2,x>>2); 
}

Question No# : 01 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# : 02 out of 20



Which of the following is false in ‘C’ Programming Language

Option A. Keywords can be used as variable names
Option B. Variable names can contain digits
Option C. Variable names do not contain blank spaces
Option D. Capital letters can be used in variable names.
True Answer A

Explanation :

Which of the following is false in ‘C’ Programming Language

Question No# : 03 out of 20



How would you round off a value from 1.66 to 2.0?

Option A. ceil(1.66)
Option B. floor(1.66)
Option C. roundup(1.66)
Option D. roundto(1.66)
True Answer A

Explanation :

How would you round off a value from 1.66 to 2.0?

Question No# : 04 out of 20



If m = 5, ++m + ++m is equal to 12.

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

Explanation :

If m = 5, ++m + ++m is equal to 12.

Question No# : 05 out of 20



Which one of the following is not a keyword in C language?

Option A. void
Option B. endl
Option C. float
Option D. switch
True Answer B

Explanation :

The endl is a predefined object of ostream class. It is used to insert a new line characters and flushes the stream. it used in C++.

Which one of the following is not a keyword in C language?

Question No# : 06 out of 20



Which is the only C function all programs must contain?

Option A. start()
Option B. printf()
Option C. main()
Option D. getch()
True Answer C

Explanation :

Which is the only C function all programs must contain?

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



Right shift of an unsigned integer by one bit is equivalent to multiplying it by two.

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

Explanation :

Right shift of an unsigned integer by one bit is equivalent to multiplying it by two.

Question No# : 10 out of 20



Two different operators would always have different associativity.

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

Explanation :
No, Two different operators may have same associativity.

Two different operators would always have different associativity.

Question No# : 11 out of 20



All of the following are valid expressions in ‘C’.

a = 2 + (b = 5);
a = b = c = 5;
a = 11 % 3

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

Explanation :

All of the following are valid expressions in ‘C’.

a = 2 + (b = 5);
a = b = c = 5;
a = 11 % 3

Question No# : 12 out of 20



Is the following statement valid in C? int my_num=100,000;

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

Explanation :

Is the following statement valid in C? int my_num=100,000;

Question No# : 13 out of 20



Arguments that take input by user before running a program are called?

Option A. main function arguments
Option B. main arguments
Option C. Command-Line arguments
Option D. Parameterized arguments
True Answer C

Explanation :

Arguments that take input by user before running a program are called?

Question No# : 14 out of 20



What is correct order of precedence in C?

Option A. Addition, Division, Modulus
Option B. Addition, Modulus, Division
Option C. Multiplication, Substration, Modulus
Option D. Modulus, Multiplication, Substration
True Answer D

Explanation :

What is correct order of precedence in C?

Question No# : 15 out of 20



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# : 16 out of 20



Which of the following is not a valid relational operator?

Option A. <
Option B. =
Option C. >=
Option D. <=
True Answer B

Explanation :

= is assignment operator which is used to assign the value of expression to the left hand variable.

Which of the following is not a valid relational operator?

Question No# : 17 out of 20



Size of short integer and long integer can be verified using the sizeof() operator

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

Explanation :

Size of short integer and long integer can be verified using the sizeof() operator

Question No# : 18 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# : 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




CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad