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 are the 4 types of organizational structures?

0 Answers  


main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }

5 Answers   Amazon, HCL, Thought Works,


struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā€œ%dā€,s.x); }

2 Answers   Vector,


To what value are pointers initialized? 1) NULL 2) Newly allocated memory 3) No action is taken by the compiler to initialize pointers.

4 Answers   Aricent,


Which is best book for data structures in c?

0 Answers  


What is anagram in c?

0 Answers  


write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }

1 Answers  


How can I read in an object file and jump to locations in it?

0 Answers  


What are the types of operators in c?

0 Answers  


What is floating point exception error? And what are different types of errors occur during compile time and run time? why they occur?

1 Answers  


c program to manipulate x=1+3+5+...+n using recursion

2 Answers   Wipro,


read an array and search an element

1 Answers  


Categories