Interesting C program


Guess the output of this C program


#include<stdio.h>
auto int k=10;
void main ()
 {
   int flag=-1;
   if(flag)
   {
     printf("k is %d",k);
   }
  else
  {
   printf("false");
  }
 }


Frenzz What is the output of above program.Enter Your Answer in the comment box.......................

Another Interesting C program
Share on Google Plus

3 comments:

  1. error will occur bcoz auto stoarge type should be inside main

    ReplyDelete
  2. auto= local...
    not external...

    ReplyDelete
  3. Yes....
    Global variables should not be of auto storage class

    ReplyDelete