QUIZ ON : C LANGUAGE - INTRODUCTION TO C LANGUAGE

INTRODUCTION TO C LANGUAGE

00:00:00

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



When the following piece of code is executed, what happens?

b = 3;
a = b++;

Option A. a contains 3 and b contains 4
Option B. a contains 4 and b contains 4
Option C. a contains 4 and b contains 3
Option D. a contains 3 and b contains 3
True Answer A

Explanation :

When the following piece of code is executed, what happens?

b = 3;
a = b++;

Question No# : 04 out of 20



Find the output of following code :

int main() 
{
int i=-2;
printf (“-i=%d”,-i);
return b;
}

Option A. –i=2
Option B. i=-2
Option C. –i=-2
Option D. –i=+2
True Answer D

Explanation :

Find the output of following code :

int main() 
{
int i=-2;
printf (“-i=%d”,-i);
return b;
}

Question No# : 05 out of 20



1.0 is an example of double constant and float constant.

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

Explanation :

1.0 is an example of double constant and float constant.

Question No# : 06 out of 20

Which of the following is an incorrect assignment statement ?

Option A. N=m=0
Option B. Value+=10
Option C. mySize=x Option D. Value=+=10
True Answer D

Explanation :

Which of the following is an incorrect assignment statement ?

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

Header file for the sqrt() function is

Option A. conio.h
Option B. string.h
Option C. math.h
Option D. graphic.h
True Answer C

Explanation :

The function sqrt() takes a single argument (in double ) and returns the square root (also in double ). The sqrt() function is defined in math. h header file. To find square root of type int , float or long double , you can explicitly convert the type to double using cast operator.

Header file for the sqrt() function is

Question No# : 09 out of 20



Precedence is used

Option A. To determine which operator evaluated first from left to right.
Option B. To determine the level of an operator in a program.
Option C. To determine how an expression involving more than one operator is evaluated.
Option D. To check the expression is valid or not.
True Answer C

Explanation :

Precedence is used

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



The conditional operator ( ? : ) is also known as

Option A. Binary operator
Option B. Unary operator
Option C. Ternary operator
Option D. All of the above
True Answer C

Explanation :

The conditional operator ( ? : ) is also known as

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

Typecasting Converts a data type to another data type

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

Explanation :

Typecasting Converts a data type to another data type

Question No# : 14 out of 20

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

What will be the output of the following code?

int main()
{
int x,y,z;
x='1'-'0';                             /* line-1 */
y='a'-'b';                            /* line-2 */
z=x+y;
printf("%d",z);
 
}

Option A. 0
Option B. Error because of incorrect line-1 only.
Option C. Error because of incorrect line-1 and line-2.
Option D. Error because of incorrect line-2 only.
True Answer A

Explanation :

What will be the output of the following code?

int main()
{
int x,y,z;
x='1'-'0';                             /* line-1 */
y='a'-'b';                            /* line-2 */
z=x+y;
printf("%d",z);
 
}

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



if a=8, b=3 and c=-5 are integers, then value of a*b/c is

Option A. -4
Option B. -2.8
Option C. +2.8
Option D. +3
True Answer A

Explanation :

if a=8, b=3 and c=-5 are integers, then value of a*b/c is

Question No# : 19 out of 20



pow(x,y) is used to

Option A. power of y to the x
Option B. power of x to the y
Option C. logarithm of x on the base y
Option D. Such function does not exist
True Answer B

Explanation :

The function pow() is used to calculate the power raised to the base value. It takes two arguments. It returns the power raised to the base value. It is declared in “math.h” header file.

pow(x,y) is used to

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