struct point
{
int x;
int y;
};
struct point origin,*pp;
main()
{
pp=&origin;
printf("origin is(%d%d)\n",(*pp).x,(*pp).y);
printf("origin is (%d%d)\n",pp->x,pp->y);
}
Answer / susie
Answer :
origin is(0,0)
origin is(0,0)
Explanation:
pp is a pointer to structure. we can access the elements of
the structure either with arrow mark or with indirection
operator.
Note:
Since structure point is globally declared x & y are
initialized as zeroes
Is This Answer Correct ? | 4 Yes | 0 No |
Sir... please give some important coding questions asked by product companies..
prog. to produce 1 2 3 4 5 6 7 8 9 10
main() { int i=5; printf("%d",++i++); }
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
write a program to Insert in a sorted list
void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }
C program to print magic square of order n where n > 3 and n is odd
Write a c program to search an element in an array using recursion
void ( * abc( int, void ( *def) () ) ) ();
void main() { int i=5; printf("%d",i+++++i); }
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }