Q. Choose a right statement.

Code:
int main()
{
    int var = 3.5;;
    printf("%f", var);

    return 0;
}
  • (A) 3.500000
  • (B) 3
  • (C) 3.5
  • (D) 0.000000
πŸ’¬ Discuss
βœ… Correct Answer: (D) 0.000000

Q. What is the output of the program.?

Code:
int main()
{
    int a = 25%10;
    printf("%d", a);

    return 0;
}
  • (A) 2.5
  • (B) 2
  • (C) 5
  • (D) Compiler error.
πŸ’¬ Discuss
βœ… Correct Answer: (C) 5

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (A) Only int variables = Okay

Q. What is the output of the C program with Modulo Division operator with - or Negative numbers.?

Code:
int main()
{
    int a = -25%-10;
    int b = -25%10;
    int c = 25%-10;
    
    printf("%d %d %d", a, b, c);

    return 0;
}
  • (A) 5 -5 5
  • (B) 5 -5 -5
  • (C) -5 -5 5
  • (D) 5 5 5
πŸ’¬ Discuss
βœ… Correct Answer: (C) -5 -5 5

Q. What is the output of the program?

Code:
int main()
{
    float a = 45;
    printf("%f", a);

    return 0;
}
  • (A) 45
  • (B) 45.0
  • (C) 45.000000
  • (D) 0.000000
πŸ’¬ Discuss
βœ… Correct Answer: (C) 45.000000

Q. What is the priority of operators *, / and % in C language.?

  • (A) * > / > %
  • (B) % > * > /
  • (C) Both % = / , * are same
  • (D) All three operators *, / and % are same.
πŸ’¬ Discuss
βœ… Correct Answer: (D) All three operators *, / and % are same.

Q. 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.
πŸ’¬ Discuss
βœ… Correct Answer: (C) (+, -) < (*, / and %)

Q. What is the Priority among (*, /, %), (+, -) and (=) C Operators.?

  • (A) (*, /, %) > (+, -) < (=)
  • (B) (*, /, %) < (+, -) < (=)
  • (C) (*, /, %) > (+, -) > (=)
  • (D) (*, /, %) < (+, -) (+, -) == (=)
πŸ’¬ Discuss
βœ… Correct Answer: (C) (*, /, %) > (+, -) > (=)

Q. What is the output of the C statement.?

Code:
int main()
{
    int a=0;
    a = 4 + 4/2*5 + 20;
    printf("%d", a);

    return 0;
}
  • (A) 40
  • (B) 4
  • (C) 34
  • (D) 54
πŸ’¬ Discuss
βœ… Correct Answer: (C) 34

Q. What is the output of the C Program?

Code:
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) 54