aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Data Types, Variables & Storage Classes
  • What will be the output of following C code? void main() ...
Multiple choice

What will be the output of following C code? void main() { int t,*pt; register int y,*py; pt=&t; py=&y; t=10; y=90; printf(%d %d,*pt,*py); }

  1. 10 90

  2. 90 10

  3. 10 10

  4. Compilation error

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

The register variable stores in Central Processing Unit (CPU). So, y does not have any memory location. Hence, py=&y is not a valid statement.

Keep practicing — related questions

  • What will be the output of the following C code? void main() { int T='T'; printf(%c,T+6); }
  • What will be the output of the following C code? void main() { int t=70,c=14,d; d=t/**//c; printf(%d,d); }
  • void main(){int *x, y;y=10;x=&y; printf(Value of y=%d n, y); printf(Value of y=%d n, *x);} What is the outp...
  • What will be the output of the following C code? void main() { int a; char *pr; int Num=288; pr=(char *)&Nu...
  • What will be output if you will Execute following c code? #include int main() { int num,a=5; num=-a--; prin...
  • What will be the output of the following program : void main() { int val=50; void *ptr; ptr=&val; printf("%...
  • What will be the output of the following: void main() { register int a; printf("%d",a); }
  • What will be the output of the following C code? void main() { int t; char *pc=(char *)0; float *pf=(float ...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy