Program -
#include<iostream.h>
#include<iostream.h>
#include<conio.h>
class abc
{
private:
int rn;
float fees;
public:
abc(int a=20,float
b=1200.25);
void write(void)
{
cout<<rn;
cout<<fees;
}
};
abc::abc(int
a,float b)
{
rn=a;
fees=b;
}
void main()
{
class abc
m1(320),m2(54,320.23);
clrscr();
m1.write();
m2.write();
getch();
}
Output -
3201200.2554320.230011
0 comments:
Post a Comment