C Programming Multiple Choice Questions (MCQ) | IT Developer <?php echo $page_title; ?>
IT Developer

C Programming Multiple Choice Questions (MCQ)

C Programming Multiple Choice Questions (MCQ) - Set 8



Share with a Friend

Multiple Choice Questions


C Programming - Multiple Choice Questions (MCQ) - Set 8

36. 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
View Answer
Correct: C




37. What will the value of variable a?
int a = 25 % 10;

A). 2.5
B). 2
C). 5
D). Compiler error
View Answer
Correct: C




38. Which of the following is a valid assignment operator?
A). +=
B). -=
C). *=
D). All of these
View Answer
Correct: D




39. What will be the value of variable d?
int a = 10, b = 5, c = 5,d;
d = b + c == a;

A). Syntax error
B). 1
C). 5
D). 10
View Answer
Correct: B




40. What is the output?
 void main() 
 { 
      int a = 10, b = 5, c = 3; 
     b != !a; 
      c = !!a; 
      printf("%d\t%d", b, c); 
 } 
A). 5  1
B). 0  3
C). 5  3
D). 1  1
View Answer
Correct: A