0% found this document useful (0 votes)
92 views8 pages

C MCQ FOR BTECH SEM II

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views8 pages

C MCQ FOR BTECH SEM II

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1) Choose a correct statement.

int a = 12 + 3 * 5 / 4 - 10

A) 12, 3, 5, 4 and 10 are Operators. +, -, * and / are


Operands. = is an increment operator.
B) 12, 3, 5, 4 and 10 are Operands. +, -, * and / are
Operators. = is decrement operator.
C) 12, 3, 5, 4 and 10 are Operands. +, -, * and / are
Operators. = is an assignment operator.
D) 12, 3, 5, 4 and 10 are Operands. +, -, * and / are Logical
Operators. = is an assignment operator.

2) Operator % in C Language is called.?


A) Percentage Operator
B) Quotient Operator
C) Modulus
D) Division
3) Output of an arithmetic expression with
integers and real numbers is ___ by default.?
A) Integer
B) Real number
C) Depends on the numbers used in the expression.
D) None of the above
4) Choose a right statement.
int a = 10 + 4.867;

A) a = 10
B) a = 14.867
C) a = 14
D) compiler error.
5) Choose a right statement.
int a = 3.5 + 4.5;

A) a = 0
B) a = 7
C) a = 8
D) a = 8.0
6) Choose a right statement.
float var = 3.5 + 4.5;

A) var = 8.0
B) var = 8
C) var = 7
D) var = 0.0
7) Choose right statement.
int main()
{
float c = 3.5 + 4.5;
printf("%f", c);

return 0;
}

A) 8.0
B) 8.000000
C) 8
D) 7

8) Choose a right statement.


int main()
{
float c = 3.5 + 4.5;
printf("%d", (int)c);

return 0;
}

A) 8.0
B) 8.000000
C) 7
D) 8
9) Choose a right statement.
int a = 5/2;
int b = 5.0/2;
int c = 5 / 2.0;
int d = 5.0/2.0;

A) a = 2, b = 2, c = 2, d= 2
B) a = 2, b = 2.0, c = 2, d= 2.0
C) a = 2, b = 2.5, c = 2.5, d= 2.5
D) a = 2.5, b = 2.5, c = 2.5, d= 2.5
10) Choose a right statement.
float a = 5/2;
float b = 5/2.0;
float c = 5.0/2;
float d = 5.0/2.0;

A) a=2.5, b=2.5, c=2.5, d=2.5


B) a=2, b=2.5, c=2.5, d=2.5
C) a=2.0, b=2.5, c=2.5, d=2.5
D) a=2.0, b=2.0, c=2.0, d=2.0
Answer [=]

11) If both numerator and denominator of a


division operation in C language are integers,
then we get.?
A) Expected algebraic real value
B) Unexpected integer value
C) Compiler error.
D) None of the above
12) Choose a right statement.
int var = 3.5;

A) a = 3.5
B) a = 3
C) a = 0
D) Compiler error
13) Choose a right statement.
int main()
{
int var = 3.5;;
printf("%f", var);

return 0;
}

A) 3.500000
B) 3
C) 3.5
D) 0.000000
14) What is the output of the program.?
int main()
{
int a = 25%10;
printf("%d", a);
return 0;
}

A) 2.5
B) 2
C) 5
D) Compiler error.
15) Can you use C Modulo Division operator % with
float and int?
A) Only int variables = Okay
B) Only float variables = Okay
C) int or float combination = Okay
D) Numerator int variable, Denominator any variable = Okay
Answer [=]

16) What is the output of the C program with


Modulo Division operator with - or Negative
numbers.?
void main()
{
int a = -25%-10;
int b = -25%10;
int c = 25%-10;
printf("%d %d %d", a, b, c);
}

A) 5 -5 -5
B) 5 -5 5
C) -5 -5 5
D) 5 5 5
17) What is the output of the program.?
int main()
{
float a = 45;
printf("%f", a); )
}

A) 45
B) 45.0
C) 45.000000
D) 0.000000
18) What is the priority of operators *, / and %
in C language.?
A) * > / > %
B) % > * > /
C) Both % = / , * are same
D) All three operators *, / and % are same.
19) In C language, which Operator group has more
priority between (*, / and %) and (+, -) groups.?
A) Both groups share equal priority.
B) (+, -) > (*, / and %)
C) (+, -) < (*, / and %)
D) None of the above.
20) Associativity of C Operators *, /, %, +, -
and = is.?
A) Operators *, / and % have Left to Right Associativity. Operators + and - have Left to
Right Associativity. Operator = has Right to Left Associativitiy.
B) Operators *, / and % have Right to Left Associativity. Operators + and - have Left to
Right Associativity. Operator = has Right to Left Associativitiy.
C) Operators *, / and % have Right to Left Associativity. Operators + and - have Right to
Left Associativity. Operator = has Right to Left Associativitiy.
D) Operators *, / and % have Right to Left Associativity. Operators + and - have Right to
Left Associativity. Operator = has Left to Right Associativitiy.
21) What is the Priority among (*, /, %), (+, -)
and (=) C Operators.?
A) (*, /, %) > (+, -) < (=)
B) (*, /, %) < (+, -) < (=)
C) (*, /, %) > (+, -) > (=)
D) (*, /, %) < (+, -) (+, -) == (=)
22) What is the output of the C statement.?
int main()
{
int a=0;
a = 4 + 4/2*5 + 20;
printf("%d", a);
return 0;
}

A) 40
B) 4
C) 34
D) 54
23) What is the output of the C Program.?
int main()
{
int a=0;
a = 10 + 5 * 2 * 8 / 2 + 4;
printf("%d", a);
return 0;
}

A) 124
B) 54
C) 23
D) 404
24) What is the output of the C Program.?
int main()
{
int a=0;
a = 4 + 5/2*10 + 5;
printf("%d", a);
return 0;
}

A) 29
B) 5
C) 4
D) 34
25) What is the output of the C Program.?
int main()
{
int a=0;
a = 10 + 2 * 12 /(3*2) + 5;
printf("%d", a);
return 0;
}

A) 31
B) 19
C) 11
D) 29
26) What is the output of the C Program.?
int main()
{
int a=0;
a = 10 + 2 * 12 / 3 * 2 + 5;
printf("%d", a);
return 0;
}

A) 19
B) 31
C) 11
D) 25
27) What is the output of the C Program.?
int main()
{
float a=10.0;
a = a % 3;
printf("%f", a);
return 0;
}

A) 0
B) 1
C) 1.000000
D) Compiler error.

28) What is the output of the C Program.?

int main()
{
float a=10.0;
a = (int)a % 3;
printf("%f", a);
return 0;
}

A) 0
B) 1
C) 1.000000
D) Compiler Error.
29) What is the output of the C Program.?
int main()
{
int a=0;
a = 14%-5 - 2;
printf("%d", a);
return 0;
}

A) 0
B) -4
C) -2
D) 2
30) What is the output of the C Program.?
int main()
{
int a= 3 + 5/2;
printf("%d", a);
return 0;
}

A) 3
B) 2
C) 5
D) Can not assign an expression to variable at the time of declaration.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy