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(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
Cau u say the output....?
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?
How do you write a program which produces its own source code as its output?
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?
write a c-program to find gcd using recursive functions
Is the following code legal? struct a { int x; struct a *b; }
source code for delete data in array for c