Menu

General Requirement Solve Hand Try Solve Without Using Compiler Q43887435

General requirement is to solve by hand and try tosolve without using a compiler.

1.) What would be the output of the following programs: (a) int main() { struct message struct messages int num; int num: cha

e struct Point { int x; int y; }; void addi(struct Point p. int i, int i) { p.X + i; P.y + j; struct Point { int x; int y; };

1.) What would be the output of the following programs: (a) int main() { struct message struct messages int num; int num: char msg1[se]; char mess1[50] char msg2[50] ; char mess2[50]: ml = {2, “If you are driven by m. num = 1; success”, “make sure that it is a quality drive” strcpy (m.msg1, “We had lot of homework.” ); strcpy(m.msg2,” Hope it is the last one); main /* assume that the strucure is located at address 2004 struct gospel m2, m3; m2 = ml: printf (“n%u%u%un”, &m.num, m.msgi, m3 m2 m.msg2 ); printf(“n%d %s %s”, minum, printf (“n%d %s %s”, m.num,m.msgi, m.msg2); m2.messi, m3.mess2); return ; c) typedef struct X { int num; int *y; }X; int main() { XX; X *p; p=&x; x. num = 10; x.y – 8x.num; // consider the address is 104 printf(“%d %d %u Xu Xu %d %d”, p->num, (p). num, &x.num, x.y, p->y, *(x.y), *(P->y)); return; d) struct Point { int x; int y; }; struct Point add( struct Point P, int i, int ) { p.X += i; p.y + j; return p; int main() { struct Point pl = {2,}; pl – add(p1, 1, 1); printf(“%d %d”, pi.x, pi.y); e struct Point { int x; int y; }; void addi(struct Point p. int i, int i) { p.X + i; P.y + j; struct Point { int x; int y; }; void add(struct Point p[], int a, int b) { for(int i-e; i<2; i++) { P[i].x += a; P[1].y += b; void add2(struct Point *p, int i, int i) { p->X + i; p->y + j; void add2(struct Point *p, int i, int i) { P->X + i; P->y + j; int main() { struct Point pl = {0,0}; addi(p1, 1, 1); printf(“%d %dn”, p1.x, pi.y); int main() { struct Point p1[2]={e, e, e, @}; add(pi, 1, 1); add2(&p1, 1, 1); printf(“%d %d”, p1.x, pl.y); return; for(int i=e; i<2; i++) { printf(“%d %dn”, p1[i].x, p1[i].y); return ; Show transcribed image text 1.) What would be the output of the following programs: (a) int main() { struct message struct messages int num; int num: char msg1[se]; char mess1[50] char msg2[50] ; char mess2[50]: ml = {2, “If you are driven by m. num = 1; success”, “make sure that it is a quality drive” strcpy (m.msg1, “We had lot of homework.” ); strcpy(m.msg2,” Hope it is the last one); main /* assume that the strucure is located at address 2004 struct gospel m2, m3; m2 = ml: printf (“n%u%u%un”, &m.num, m.msgi, m3 m2 m.msg2 ); printf(“n%d %s %s”, minum, printf (“n%d %s %s”, m.num,m.msgi, m.msg2); m2.messi, m3.mess2); return ; c) typedef struct X { int num; int *y; }X; int main() { XX; X *p; p=&x; x. num = 10; x.y – 8x.num; // consider the address is 104 printf(“%d %d %u Xu Xu %d %d”, p->num, (p). num, &x.num, x.y, p->y, *(x.y), *(P->y)); return; d) struct Point { int x; int y; }; struct Point add( struct Point P, int i, int ) { p.X += i; p.y + j; return p; int main() { struct Point pl = {2,}; pl – add(p1, 1, 1); printf(“%d %d”, pi.x, pi.y);
e struct Point { int x; int y; }; void addi(struct Point p. int i, int i) { p.X + i; P.y + j; struct Point { int x; int y; }; void add(struct Point p[], int a, int b) { for(int i-e; iX + i; p->y + j; void add2(struct Point *p, int i, int i) { P->X + i; P->y + j; int main() { struct Point pl = {0,0}; addi(p1, 1, 1); printf(“%d %dn”, p1.x, pi.y); int main() { struct Point p1[2]={e, e, e, @}; add(pi, 1, 1); add2(&p1, 1, 1); printf(“%d %d”, p1.x, pl.y); return; for(int i=e; i

Expert Answer


Answer to General requirement is to solve by hand and try to solve without using a compiler. …

OR