613 views
0 votes
0 votes
#define value 50

main()

{

printf("%d",value);

#define value 500

printf("%d",value*10);

}



what is the output

1 Answer

0 votes
0 votes
505000

the preprocessor should place the 'value' value i.e 50 or 500 whereever it find the 'value'.

Hence after preprocessing the program should look like

main()
{
    printf("%d",50);                            // due to define value 50
    printf("%d",500*10);                     // due to define value 500
}
 

Note : I m ignoring the fact that we have not mentioned the return type and stdio.h header file
edited by

No related questions found