aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming Fundamentals
  • What will be the value of 'a' in the following C code? in...
Multiple choice

What will be the value of 'a' in the following C code? int a=5; printf(&"&a=%d&"&,a&2);

  1. a=5

  2. a=1

  3. a=2

  4. a=0

  5. a=3

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

This is the correct option as bitwise AND operator, when operated on binary 0101 and 0010 results in 0000.

Keep practicing — related questions

  • Consider the following C statement. int a = 3,b = 2; a+ = b++; printf(!!!^!!!a = %d!!!^!!!,a); What would b...
  • What will be the value of i? int i = 1; i = i +2*i ++; printf(“%d”,i);
  • What would be the output of the following 'C' statement? void main() { int i=1, j=5; while(i<j) { printf("v...
  • int a=10,b; b=a++ + ++a; printf(%d,%d,%d,%d,b,a++,a,++a); What will be the output when following code is ex...
  • What will be the output of the following code? #include<stdio.h> int main() { int num,a=5; num=-a--; printf...
  • What would be the value of variables n and m in the following C code? int n, m; n = - 10; m = - n + 5; prin...
  • What is the output of the following code? #include void main() { int a=0,b=0; a = (b = 75) + 9; printf("\n%...
  • What will be the output of the following C code? void main() { int t=70,c=14,d; d=t/**//c; printf(%d,d); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy