write a program in 'c' to find the value of p[i+1]^n.p,i,n
are arguments of a macro and n is a integer



write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and ..

Answer / ataraxic

int data[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

#define GET(p, i, n) \
({ \
p[i+1]^n; \
})

int main(int argc, char *argv[], char *envp[])
{
int res = GET(data, 2, 1);
printf("%d\n", res);
exit(EXIT_SUCCESS);
}

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Interview Questions

can anyone please tell about the nested interrupts?

0 Answers  


Is main is a keyword in c?

0 Answers  


what will be the out put. #include<stdio.h> void main() { printf("Output:"); printf(1+"vikashpatel"); }//output: ikashpatel

1 Answers   V2 Solutions,


how the size of an integer is decided? - is it based on processor or compiler or OS?

19 Answers   HCL, JPR, Microsoft, nvidia,


What is scanf_s in c?

0 Answers  






Explain what is a static function?

0 Answers  


What is a 'null pointer assignment' error?

0 Answers  


What is a constant?

0 Answers  


What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); }

8 Answers   ADITI, Adobe,


What is the return type of sizeof?

0 Answers  


If the static variable is declared as global, will it be same as extern?

1 Answers   Samsung,


What is the purpose of 'register' keyword in c language?

0 Answers  


Categories