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 |
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
why the range of an unsigned integer is double almost than the signed integer.
Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).
Write a C program to add two numbers before the main function is called.
How can you relate the function with the structure? Explain with an appropriate example.
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }
why is printf("%d %d %d",i++,--i,i--);
Sir... please give some important coding questions asked by product companies..
main() { char not; not=!2; printf("%d",not); }