C Programming MCQs with answers Page - 24

Here, you will find a collection of MCQ questions on C Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

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

Code:
int main()
{
    int a=0;
    a = 5>2 ? printf("4"): 3;
    printf("%d",a);

    return 0;
}
  • (A) 0
  • (B) 14
  • (C) 41
  • (D) compiler error

A

Admin • 833.24K Points
Coach

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

Code:
int main()
{
    int a=0;
    a = (5>2) ? : 8;
    printf("%d",a);

    return 0;
}
  • (A) 0
  • (B) 1
  • (C) 8
  • (D) compiler error

A

Admin • 833.24K Points
Coach

Q. What is the output of C Program.?

Code:
int main()
{
    int a=0, b;
    a = (5>2) ? b=6: b=8;
    printf("%d %d",a, b);

    return 0;
}
  • (A) 6 6
  • (B) 0 6
  • (C) 0 8
  • (D) compiler error

A

Admin • 833.24K Points
Coach

Q. Choose a correct statement regarding C Comparison Operators.

  • (A) (x == y) Is x really equal to y. (x != y) Is x not equal to y.
  • (B) (x < y) Is x less than y (x > y) Is x greater than y
  • (C) (x <= y) Is x less than or equal to y. (x >= y) Is x greater than or equal to y
  • (D) All of the above

A

Admin • 833.24K Points
Coach

Q. Choose a statement to use C If Else statement.

  • (A) else if is compulsory to use with if statement.
  • (B) else is compulsory to use with if statement.
  • (C) else or else if is optional with if statement.
  • (D) None of the above

A

Admin • 833.24K Points
Coach

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

Code:
int main()
{
    if( 4 > 5 )
    {
        printf("Hurray..
");
    }
     printf("Yes");

    return 0;
}
  • (A) Yes
  • (B) Hurray..
  • (C) Hurray..Yes
  • (D) Compiler error

A

Admin • 833.24K Points
Coach

Q. What is the Priority of C Logical Operators.? NOT (!), AND (&&) and OR (||)

  • (A) NOT (!) > AND (&&) > OR (||)
  • (B) NOT (!) > AND (&&) = OR (||)
  • (C) AND (&&) > OR (||) > NOT (!)
  • (D) AND (&&) = OR (||) > NOT (!)

A

Admin • 833.24K Points
Coach

Q. Choose a correct C Operator Priority.?
Items in one group ( ) has same priority.

  • (A) ( ! ) < (*, /, %) < (+, -) < ( <, <=, >, >=) < (==, !=) < (&&) < (||) < (=)
  • (B) (( ! ) , (*, /, %) , (+, -)) < ( <, <=, >, >=) < (==, !=) < (&&) < (||) < (=)
  • (C) ( ! ) > (*, /, %) > (+, -) > ( <, <=, >, >=) > (==, !=) > (&&) > (||) > (=)
  • (D) (( ! ) , (*, /, %) , (+, -)) > ( <, <=, >, >=) > (==, !=) > (&&) > (||) > (=)

A

Admin • 833.24K Points
Coach

Q. What is the output of C Program.?

Code:
int main()
{
    int a=5, b=8;
    
    if( a==5 && (b=9) )
    {
        printf("Gorilla Glass=");
    }
    printf("%d %d", a, b);

    return 0;
}
  • (A) 5 8
  • (B) 5 9
  • (C) Gorilla Glass=5 8
  • (D) Gorilla Glass=5 9

A

Admin • 833.24K Points
Coach

Q. Choose a right C Statement.

  • (A) Loops or Repetition block executes a group of statements repeatedly.
  • (B) Loop is usually executed as long as a condition is met.
  • (C) Loops usually take advantage of Loop Counter
  • (D) All of the above

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ