hello
1.What would be the output of the following program?
main()
{
  extern int i;
   i=20;
   printf("%d",sizeof(i));
}

(a) 2
(b) 4
(c) Would vary from compiler to compiler
(d)Error,i undefined

     


2).What would be the output of the following program?
   main()
 {
   extern int a;
   printf("\n%d",a);
 }int a=20;

(a)20
(b)0
(c) garbage value
(d)error

     


3).what will be the output?
main()
 {
   int a[5]={2,3};
   printf("\n%d%d%d",a[2],a[3],a[4]);
}


(a)garbage values
(b)2 3 3
(c)3 2 2
(d)0 0 0

     


4).Point out the error if any in the for loop:
  main()
  {
    int i=1;
     for(;;)
   {
     printf("%d",i++);
      if(i>10)
       break;
}
}

(a) the condition in the for loop is a must
(b)the 2 semicols should be droped
(c) the for loop should be replaced by while loop
(d) no error

     


5).Point out the erro if any
main()
{
  int a=10;
   switch(a)
   {
   }
   printf("program never die they just lost in processing");
}

(a)1
(b)2
(c)3
(d)no error

     


Next page