Program -
#include<iostream.h>
#include<iostream.h>
#include<conio.h>
class abc
{
private:
int a;
float b;
public:
abc(int x,float y)
{
a=x;
b=y;
}
void write(void)
{
cout<<a<<b;
}
};
void main()
{
abc m1(20,3.2);
clrscr();
m1.write();
abc(25,3.4).write();
getch();
}
Output -
203.2253.4
0 comments:
Post a Comment