#define prod(a,b) a*b

main()

{

int x=3,y=4;

printf("%d",prod(x+2,y-1));

}



#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); ..

Answer / susie

Answer :

10

Explanation:

The macro expands and evaluates to as:

x+2*y-1 => x+(2*y)-1 => 10

Is This Answer Correct ?    50 Yes 2 No

Post New Answer

More C Code Interview Questions

void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above

2 Answers   HCL,


main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 Answers  


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  






char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  


Printf can be implemented by using __________ list.

3 Answers  


struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error

3 Answers   HCL,


how to delete an element in an array

2 Answers   IBM,


void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  


write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).

0 Answers   CDAC, College School Exams Tests,


main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;

1 Answers  


Categories