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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is #define used?

802


Can the curly brackets { } be used to enclose a single line of code?

721


what is the format specifier for printing a pointer value?

622


Explain what are preprocessor directives?

636


What functions are in conio h?

669






What is the main difference between calloc () and malloc ()?

583


How do you list files in a directory?

573


What is the difference between if else and switchstatement

1326


can we change the default calling convention in c if yes than how.........?

2045


Explain what is dynamic data structure?

658


How can I avoid the abort, retry, fail messages?

673


Is that possible to add pointers to each other?

910


How was c created?

601


What is && in c programming?

687


What do you mean by Recursion Function?

636