Menu
Popular Courses
Search

MCQs


Total Questions : 97 | Page 1 of 10 pages
Question 1. What is the output of this C code?

    int main()

    {

        int i = 0, j = 0;

        while (l1: i < 2)

        {

            i++;

            while (j < 3)

            {

                printf("loop\n");

                goto l1;

           }

        }

   }

  1.    loop loop
  2.    Compile time error
  3.    loop loop loop loop
  4.    Infinite loop
 Discuss Question
Answer: Option B. -> Compile time error


none


Question 2. What is the output of this C code?

    int main()

    {

        int i = 0, j = 0;

        l1: while (i < 2)

            {

                i++;

                while (j < 3)

                {

                    printf("loop\n");

                    goto l1;

                }

            }

   }

  1.    loop loop
  2.    Compile time error
  3.    loop loop loop loop
  4.    Infinite loop
 Discuss Question
Answer: Option A. -> loop loop


none


Question 3. The output of the code below is?

    int x;

    void main()

    {

        if (x)

            printf("hi");

        else

            printf("how are u");

    }

  1.    hi
  2.    how are you
  3.    Compile time error
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> how are you


none


Question 4. The output of the code below is?

    void main()

    {

        int x = 5;

        if (x < 1)

            printf("hello");

        if (x == 5)

            printf("hi");

        else

            printf("no");

    }

  1.    hi
  2.    hello
  3.    no
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> hi


none


Question 5. Comment on the following code below?

    void main()

    {

       int x = 5;

        if (true);

            printf("hello");

    }

  1.    It will display hello
  2.    It will throw an error
  3.    Nothing will be displayed
  4.    Compiler dependent
 Discuss Question
Answer: Option B. -> It will throw an error


none


Question 6. What is the output of this C code?

    int main()

    {

        int x = 0;

        if (x == 0)

           printf("true, ");

        else if (x = 10)

            printf("false, ");

        printf("%d\n", x);

    }

  1.    false, 0
  2.    true, 0
  3.    true, 10
  4.    Compile time error
 Discuss Question
Answer: Option B. -> true, 0


none


Question 7. Which of the following is an invalid if-else statement?
  1.    if (if (a == 1)){}
  2.    if (func1 (a)){}
  3.    if (a){}
  4.    if ((char) a){}
 Discuss Question
Answer: Option A. -> if (if (a == 1)){}


none


Question 8. What is the output of this C code?

    int main()

    {

        int a = 1;

        if (a--)

            printf("True");

            if (a++)

                printf("False");

    }

  1.    True
  2.    False
  3.    True False
  4.    No Output
 Discuss Question
Answer: Option A. -> True


none


Question 9. What is the output of this C code?

    int main()

    {

        int x = 0;

        if (x == 1)

            if (x >= 0)

                printf("true\n");

            else

                printf("false\n");

    }

  1.    true
  2.    false
  3.    Depends on the compiler
  4.    No print statement
 Discuss Question
Answer: Option D. -> No print statement


none


Question 10. if (a == 1||b == 2){} can be written as:
  1.    if (a == 1)     if (b == 2){}
  2.    if (a == 1){}     if (b == 2){}
  3.    if (a == 1){}     else if (b == 2){}
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


none


Share this page with your friends!

Share this page with your friends!

Latest Videos

Chapter 1 - GLOBAL STEEL SCENARIO & INDI Part 1 : (13-04-2024) INDUSTRY AND COMPANY AWARENESS (ICA)
Direction Sense Test Part 1 Reasoning (Hindi)
Chapter 1 - RMHP / OHP / OB & BP Part 1 : (14-02-2024) GPOE
Cube & Cuboid Part 1 Reasoning (Hindi)
Data Interpretation (DI) Basic Concept Reasoning (Hindi)
Counting Figures Part 1 Counting Of Straight Lines Reasoning (Hindi)
Real Numbers Part 7 Class 10 Maths
Real Numbers Part 1 Class 10 Maths
Polynomials Part 1 Class 10 Maths

Latest Test Papers

Chapter 3.1 : Overview of Finance & Acco Chapter 3 : Finance & Accounts SAIL E0 - GFM 2024
Chapter 2.1 : Overview Chapter 2 : Materials Management SAIL E0 - GFM 2024
Chapter 1.1 : Personnel Functions- An ov Chapter 1 : Personnel Management SAIL E0 - GFM 2024
GPOE / GPA Combined 1 Free CBT Mock Test SAIL E0 2024
CBT Mixed Test 1 GPOE/GPA SAIL E0 2024