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() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
Write a function to find the depth of a binary tree.
13 Answers Adobe, Amazon, EFI, Imagination Technologies,
how to return a multiple value from a function?
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
write a simple calculator c program to perform addition, subtraction, mul and div.
0 Answers United Healthcare, Virtusa,
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }