Log In Register

Units


Assigment Operators & Expressions - Questions and Answers

 

Practice these Assigment Operators & Expressions  under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Assigment Operators & Expressions for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Assigment Operators & Expressions of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Assigment Operators & Expressions .
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Assigment Operators & Expressions under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Assigment Operators & Expressions topic of C Programming:

 

1.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         int k = 8;
  5.         int x = 0 == 1 && k++;
  6.         printf("%d%d\n", x, k);
  7.     }

Answer: Option C

Explanation:

2.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         1 < 2 ? return 1: return 2;
  5.     }

Answer: Option A

Explanation:

3.

Operation “a = a * b + a” can also be written as:

Answer: Option D

Explanation:

4.

for c = 2, value of c after c <<= 1;

Answer: Option A

Explanation:

5.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int x = 1, y = 0;
  5.         x &&= y;
  6.         printf("%d\n", x);
  7.     }

Answer: Option C

Explanation:

6.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         unsigned int x = -5;
  5.         printf("%d", x);
  6.     }

Answer: Option B

Explanation:

7.

What is the type of the below assignment expression if x is of type float, y is of type int?
     y = x + y;

Answer: Option D

Explanation:

8.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char a = 'a';
  5.         int x = (a % 10)++;
  6.         printf("%d\n", x);
  7.     }

Answer: Option B

Explanation:

9.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int a = 1, b = 2;
  5.         a += b -= a;
  6.         printf("%d %d", a, b);
  7.     }

Answer: Option B

Explanation:

10.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int x = 2, y = 2;
  5.         x /= x / y;
  6.         printf("%d\n", x);
  7.         return 0;
  8.     }

Answer: Option D

Explanation:

11.

What is the value of the below assignment expression
     (x = foo())!= 1 considering foo() returns 2

Answer: Option C

Explanation:

12.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int a = 4, n, i, result = 0;
  5.         scanf("%d", n);
  6.         for (i = 0;i < n; i++)
  7.         result += a;
  8.     }

Answer: Option B

Explanation:

13.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         int x = 0;
  5.         if (x = 0)
  6.             printf("Its zero\n");
  7.         else
  8.             printf("Its not zero\n");
  9.     }

Answer: Option D

Explanation:

14.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int x = 2, y = 1;
  5.         x *= x + y;
  6.         printf("%d\n", x);
  7.         return 0;
  8.     }

Answer: Option C

Explanation:

15.

Which of the following is an invalid assignment operator?

Answer: Option D

Explanation: