main ( )
{
static char *s[ ] = {“black”, “white”, “yellow”,
“violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s”,*--*++p + 3);
}
Answer / susie
Answer :
ck
Explanation:
In this problem we have an array of char pointers pointing
to start of 4 strings. Then we have ptr which is a pointer
to a pointer of type char and a variable p which is a
pointer to a pointer to a pointer of type char. p hold the
initial value of ptr, i.e. p = s+3. The next statement
increment value in p by 1 , thus now value of p = s+2. In
the printf statement the expression is evaluated *++p causes
gets value s+1 then the pre decrement is executed and we get
s+1 – 1 = s . the indirection operator now gets the value
from the array of s and adds 3 to the starting address. The
string is printed starting from this position. Thus, the
output is ‘ck’.
| Is This Answer Correct ? | 5 Yes | 0 No |
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
main() { int i=5,j=6,z; printf("%d",i+++j); }
plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }
Write a procedure to implement highlight as a blinking operation
why nlogn is the lower limit of any sort algorithm?
Write a routine that prints out a 2-D array in spiral order
Give a one-line C expression to test whether a number is a power of 2.
void main() { int i=5; printf("%d",i+++++i); }