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

pascal triangle program

2 Answers  


yogesh patil in dell

3 Answers   DELL,


What is the difference between union and anonymous union?

0 Answers   Hexaware,


what is the defrenece between structure and union

5 Answers   Aloha Technology,


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

0 Answers   TCS,


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

0 Answers   Amazon,


Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops.

12 Answers   MIT, TCS,


struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??

9 Answers   Verifone,


What are the 4 types of functions?

0 Answers  


do you think its fraud or original company?

0 Answers  


write a program that prints a pascal triangle based on the user input(like how many stages) in an efficient time and optimized code?

3 Answers   Oracle,


What is assert and when would I use it?

0 Answers  


Categories