Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


#define f(x)
main()
{
printf("\n%d",f(2+2));
}

Answers were Sorted based on User's Feedback



#define f(x) main() { printf("\n%d",f(2+2)); }..

Answer / g.j.hemalatha

f(x) is an identifier.No constants is defined in the macro
definition.So the answer is a garbage value.

Is This Answer Correct ?    2 Yes 0 No

#define f(x) main() { printf("\n%d",f(2+2)); }..

Answer / priyadarshan kasta

it will show a error message as expression syntax error

Is This Answer Correct ?    1 Yes 0 No

#define f(x) main() { printf("\n%d",f(2+2)); }..

Answer / civa

Compiler Error "error: syntax error before ')' token"

Is This Answer Correct ?    1 Yes 1 No

#define f(x) main() { printf("\n%d",f(2+2)); }..

Answer / suman halder

within printf statement,f(2+2) i.e f(4) must return a value so that this value could get printed through %d format specifier..
Now,as f(x) is a macro template and macro expansion code for this template is not specified..so,here the situation is like,we are trying to return an integer value from a function which is having a "void" return type..
so,compiler flashes "Expression syntax error"..as during preprocessing macro template can't be replaced by macro expansion...

Is This Answer Correct ?    0 Yes 0 No

#define f(x) main() { printf("\n%d",f(2+2)); }..

Answer / hema

0

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

What is #pragma statements?

0 Answers  


Explain what is the use of a semicolon (;) at the end of every program statement?

0 Answers  


IS STRUCTURES CAN BE USED WITHIN AN ARRAY?

7 Answers   Caritor,


what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }

4 Answers  


What type is sizeof?

0 Answers  


Write a program to print all permutations of a given string.

0 Answers   JPMorgan Chase,


What are the main characteristics of c language describe the structure of ac program?

0 Answers  


How can I increase the allowable number of simultaneously open files?

1 Answers   ABC,


What is a function in c?

2 Answers  


How can I insert or delete a line (or record) in the middle of a file?

0 Answers  


What is the mean of this statement:: if(int i=0 * i=9)

2 Answers   HCL,


What are the different categories of functions in c?

0 Answers  


Categories