Friday 29 May 2009

Name of function cannot be exactly same as of name of other function or identifier within the scope of the function.




(1) What will be output of following c program?

#include



int main(){

   int number,val;

   number=5<<2+5>>2;

   val=++number;

   val=number(val);

   printf("%d",val);

   return 0;

}

int number(int val){

   val=~val;

  return val;

}




Output: Compilation error


Explanation: number is function name as well as name of

No comments:

Post a Comment