Sail E0 Webinar

MCQs

Total Questions : 73 | Page 7 of 8 pages
Question 61.

What is the output of this C code?    void main()    {        int x = 0;        if (x = 0)            printf("Its zero\n");        else            printf("Its not zero\n");    }

  1.    Its not zero
  2.    Its zero
  3.    Run time error
  4.    None
 Discuss Question
Answer: Option A. -> Its not zero


None.


Question 62. What is the output of this C code?    int main()    {        int a = 20, b = 15, c = 5;        int d;        d = a == (b + c);        printf("%d", d);    }
  1.    1
  2.    40
  3.    10
  4.    5
 Discuss Question
Answer: Option A. -> 1


None.


Question 63. What is the output of this C code?    void main()    {        char a = 'a';        int x = (a % 10)++;        printf("%d\n", x);    }
  1.    6
  2.    Junk value
  3.    Compile time error
  4.    7
 Discuss Question
Answer: Option C. -> Compile time error


None.


Question 64. What is the type of the below assignment expression if x is of type float, y is of type int?        y = x + y;
  1.    int
  2.    float
  3.    There is no type for an assignment expression
  4.    double
 Discuss Question
Answer: Option A. -> int


None.


Question 65. Operation "a = a * b + a can also be written as:
  1.    a *= b + 1;
  2.    (c = a * b)!=(a = c + a);
  3.    a = (b + 1)* a;
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


None.


Question 66. What is the output of this C code?    int main()    {        int a = 1, b = 2;        a += b -= a;        printf("%d %d", a, b);    }
  1.    1   1
  2.    1   2
  3.    2   1
  4.    2   2
 Discuss Question
Answer: Option C. -> 2   1


None.


Question 67. for c = 2, value of c after c
  1.    c = 1;
  2.    c = 2;
  3.    c = 3;
  4.    c = 4;
 Discuss Question
Answer: Option D. -> c = 4;


None.


Question 68. What is the value of the below assignment expression      (x = foo())!= 1 considering foo() returns 2
  1.    2
  2.    true
  3.    1
  4.    0
 Discuss Question
Answer: Option A. -> 2


None.


Question 69.

What is the output of this C code?    int main()    {        int a = 4, n, i, result = 0;        scanf("%d", n);        for (i = 0;i < n; i++)        result += a;    }

  1.    Addition of a and n.
  2.    Subtraction of a and n.
  3.    Multiplication of a and n.
  4.    Division of a and n.
 Discuss Question
Answer: Option C. -> Multiplication of a and n.


None.


Question 70. Which of the following is an invalid assignment operator?
  1.    a %= 10;
  2.    a /= 10;
  3.    a |= 10;
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


None.


Latest Videos

Latest Test Papers