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 the best way to store flag values in a program?

0 Answers  


How can you dynamically allocate memory in C?

2 Answers  


Why does not use getgh(); and <conio.h> in c language.

3 Answers   Elofic,


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..

1 Answers  


Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.

0 Answers  


why Language C is plateform dependent

3 Answers   Siemens, Wipro,


difference of two no's with out using - operator

7 Answers  


what is the difference between NULL('\0') and 0?

14 Answers   Microsoft,


In c language can we compile a program without main() function?

0 Answers  


write a c program to accept a given integer value and print its value in words

4 Answers   Vernalis, Vernalis Systems,


difference between function & structure

9 Answers   Verizon,


Categories