Sunday 5 April 2009

Question of c preprocessor with detailed solution

C programming preprocessor
questions and explanations



(1) What will be output of following code?






#include

#define max 10




int main(){




    int i;




    i=++max;




    printf("%d",i);




    return 0;

}






(2) What will be output of
following code?






#include

#define max 10+2




int main(){




    int i;




    i=max*max;




    printf("%d",i);

No comments:

Post a Comment