Sail E0 Webinar

MCQs

Total Questions : 73 | Page 6 of 8 pages
Question 51. What is the output of this C code?    int main()    {        int x = 1, y = 0, z = 3;        x > y ? printf("%d", z) : return z;    }
  1.    3
  2.    1
  3.    Compile time error
  4.    Run time error
 Discuss Question
Answer: Option C. -> Compile time error


None.


Question 52. What is the output of this C code?    void main()    {        int x = 1, z = 3;        int y = x
  1.    -2147483648
  2.    -1
  3.    Run time error
  4.    8
 Discuss Question
Answer: Option D. -> 8


None.


Question 53. What is the output of this C code?    int main()    {        int i = 1;        if (i++ && (i == 1))            printf("Yes\n");        else            printf("No\n");    }
  1.    Yes
  2.    No
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option B. -> No


None.


Question 54. What is the output of this C code?    void main()    {        int x = 0, y = 2, z = 3;        int a = x & y | z;        printf("%d", a);    }
  1.    3
  2.    0
  3.    2
  4.    Run time error
 Discuss Question
Answer: Option A. -> 3


None.


Question 55. What is the final value of j in the below code?    int main()    {        int i = 0, j = 0;        if (i && (j = i + 10))            //do something            ;    }
  1.    0
  2.    10
  3.    Depends on the compiler
  4.    Depends on language standard
 Discuss Question
Answer: Option A. -> 0


None.


Question 56. Relational operators cannot be used on:
  1.    structure
  2.    long
  3.    strings
  4.    float
 Discuss Question
Answer: Option A. -> structure


None.


Question 57. Which among the following is NOT a logical or relational operator?
  1.    !=
  2.    ==
  3.    ||
  4.    =
 Discuss Question
Answer: Option D. -> =


None.


Question 58. What is the output of this C code?    int main()    {        int a = 10;        if (a == a--)            printf("TRUE 1\t");        a = 10;        if (a == --a)            printf("TRUE 2\t");    }
  1.    TRUE 1
  2.    TRUE 2
  3.    TRUE 1  TRUE 2
  4.    No output
 Discuss Question
Answer: Option C. -> TRUE 1  TRUE 2


None.


Question 59. What is the output of this C code?    int main()    {        int a = 20;        double b = 15.6;        int c;        c = a + b;        printf("%d", c);    }
  1.    35
  2.    36
  3.    35.6
  4.    30
 Discuss Question
Answer: Option A. -> 35


None.


Question 60. What is the output of this C code?    void main()    {        int k = 8;        int x = 0 == 1 && k++;        printf("%d%d\n", x, k);    }
  1.    0   9
  2.    0   8
  3.    1   9
  4.    1   8
 Discuss Question
Answer: Option B. -> 0   8


None.


Latest Videos

Latest Test Papers