aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programs (GATE)
  • Find the output of the following C program: main(){char c...
Multiple choice

Find the output of the following C program:

main(){char ch='A';printf(%d%d,sizeof(ch),sizeof(A));}

  1. 1 1

  2. 1 2

  3. 2 2

  4. 2 1

  5. Error

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

sizeof(ch) = 1 and sizeof('A') = 2

Keep practicing — related questions

  • Find the output of the following C program: main(){printf(%c, abcdefgh[4]);}
  • What will be the output of the following function? #define int char main() { int i=65; printf(%d,sizeof(i)); }
  • What is the output ? main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
  • Find the output of this program. main() { int i=5; printf(“%d”,i=++i ==6); }
  • Find the output of this program. main() { int i=5; printf(“%d”,i=++i ==6); }
  • Find the output of this program. main() { int a[10]; printf("%d",*a+1-*a+3) ; }
  • Find the output of this program. main() { int a[10]; printf("%d",*a+1-*a+3) ; }
  • Find the output of the following C program: Main(){int i;For(i=1;i <=10;i ++){Printf(%d ”,i);i=i+1;}}
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Output Evaluation (1721 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy