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 |
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
How to read a directory in a C program?
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
Display the time of the system and display the right time of the other country
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }