All Exams Test series for 1 year @ ₹349 only
Question

Consider following conditional statements if (m == 20 – 10 || n > 10). The order of execution of the following operations is

A. ==

B. –

C. ||

D. >

Choose the correct answer from the options given below:

This question was previously asked in
UGC NET 2024 Computer Science and Applications Question Paper (23-Aug-2024) (Shift 1)
The correct answer is

B, D, A, C

In C, an expression is grouped according to operator precedence: arithmetic operators bind tighter than relational operators, relational operators (<, >, <=, >=) bind tighter than equality operators (==, !=), and the logical OR operator || has lower precedence than all of these.

Step 1 — The subtraction 20 – 10 (B) has the highest precedence of the four, so it is grouped first, giving m == 10.

Step 2 — The relational operator > (D) comes next: n > 10.

Step 3 — The equality operator == (A) is lower than >, giving (m == 10).

Step 4 — The logical OR || (C) has the lowest precedence and combines the two results: (m == (20 – 10)) || (n > 10).

OperatorPrecedence level (higher first)
– (additive)higher
> (relational)lower than additive
== (equality)lower than relational
|| (logical OR)lowest of the four

Placing > before – ignores that arithmetic binds tightest; putting || before == treats logical OR as stronger than equality; starting with == ignores both the arithmetic and relational levels.

B, D, A, C option is correct.

Was this answer helpful?

Similar Questions

  1. What will be the output of the following ‘C’ code ?

    main ( )

    { int x = 128;

    printf (“\n%d”, 1 + x ++);

    }

  2. Code blocks allow many algorithms to be implemented with the following parameters :

  3. Match the following with respect to the jump statements :

    List - IList - II
    a. returni. The conditional test and increment portions
    b. gotoii. A value associated with it
    c. breakiii. Requires a label for operation
    d. continueiv. An exit from only the innermost loop
  4. The control string in C++ consists of three important classifications of characters

  5. Match the following with respect to I/O classes in object oriented programming :

    List - IList - II
    a. fopen()i. returns end of file
    b. fclose()ii. return for any problem report
    c. ferror()iii. returns 0
    d. feof()iv. returns a file pointer
  6. Which of the following is the correct value returned to the operating system upon the successful completion of a program ?

  7. Consider the following program :

    #include<stdio.h>

    main( )

    {

        int i, inp;

        float x, term=1, sum=0;

        scanf(“%d %f ”, & inp, &x);

        for(i=1; i<=inp; i++)

        {

            term = term * x/i;

            sum = sum + term ;

        }

        printf(“Result = %f\n”, sum);

    }

    The program computes the sum of which of the following series ?

  8. Given that \(x=7.5\), j = -1.0, n = 1.0, m = 2.0

    the value of --x+j==x>n>=m is :

  9. Which of the following is false regarding the evaluation of computer programming languages ?

  10. Match the LIST-I with LIST-II

    LIST-I
    (FUNCTIONS)
    LIST-II
    (Uses of functions)
    A. fseek ()I. Gives the current position in the file
    B. ftell()II. Sets the position to the beginning of the file
    C. feof ()III. Sets the position to a desired point in the file
    D. rewind()IV. Used to test for an end of file condition.

    Choose the correct answer from the options given below:


Important Questions from Programming in C

  1. Consider the following C program:
    #include <stdio.h>
    int g(int n) {
    return (n+10);
    }
    int f(int n) {
    return g(n*2);
    }
    int main() {
    int sum, n;
    sum=0;
    for (n=1; n<3; n++)
    sum + = g(f(n));
    printf ("%d", sum);
    return 0;
    }
    The output of the given C program is ____________ (Answer in integer)

  2. Determine what's true for x, if we define int *x[10] ?
  3. In bitwise operator, each right shift operator divides by ________.
  4. In Switch-case, the ________ is not allowed to be case labels.
  5. In C++, ________ functions are not actually called, rather, their codes are expanded
Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
300 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App