0

Can anyone tell me the output of this program and help me to know how did you get that....pls

#include<iostream.h> struct point { int X,Y; }; void show (point P) { cout<<P.X<<":"<<P.Y<<endl; } int main() { Point U = {20,10},V,W; V=U; V.X+=20; W=V; U.Y+=10; U.X+=5; W.X-=5; show(U); show(V); show(W); return0; }

15th Jan 2017, 2:53 PM
Vaibhav Gangian
Vaibhav Gangian - avatar
4 Answers
+ 2
first U is {x=20;y=10;} V is now {x=20;y=10}; V.x=40; W={x=40;y=10;} U.y=20; U.x=25; W.x=35; //the output is: 20:25 40:10 35:10
15th Jan 2017, 3:04 PM
A M ~ Smart !
A M ~ Smart ! - avatar
+ 2
ali sir thanks one more time....tomorrow is my computer EXAM in school...with this help I have solved 3 more questions
15th Jan 2017, 3:16 PM
Vaibhav Gangian
Vaibhav Gangian - avatar
+ 1
thanks a lot...
15th Jan 2017, 3:05 PM
Vaibhav Gangian
Vaibhav Gangian - avatar
+ 1
welcome 😊
15th Jan 2017, 3:06 PM
A M ~ Smart !
A M ~ Smart ! - avatar