#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
struct point
{
float x;
float y;
public :
void getxy (float xcord, float ycord)
{
x=xcord;
y=ycord;
}
void showxy ()
{
cout<<"X coordinates = "<<x<<endl;
cout<<"Y coordinates = " <<y;
}
};
main()
{
point p;
clrscr();
p.getxy(10, 5);
p.showxy();
getch();
}
#include<conio.h>
#include<iomanip.h>
struct point
{
float x;
float y;
public :
void getxy (float xcord, float ycord)
{
x=xcord;
y=ycord;
}
void showxy ()
{
cout<<"X coordinates = "<<x<<endl;
cout<<"Y coordinates = " <<y;
}
};
main()
{
point p;
clrscr();
p.getxy(10, 5);
p.showxy();
getch();
}
0 Comments:
Post a Comment