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 / 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 |
1. Write a program to reverse every second word in a given sentence.
why do we use pointer instead directly acessing the data?
long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes
18 Answers Acropolis, HCL, Intel, TCS,
what are bitwise shift operators?
prog for 1st five prime numbers in 2^x - 1
Which is the memory area not included in C program? give the reason
what is the difference between global variable & static variable declared out side all the function in the file.
Discuss the function of conditional operator, size of operator and comma operator with examples.
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
how to copy a string without using c function
How variables are declared in c?
main() { int i = 1; int num[] = {1,2,3,4}; num[i] = i++; printf("%d", num[i]); } what will be the output? }
22 Answers NDS, TCS,