.
Home About-us Privacy Policy Contact-us Services

Thursday, October 8, 2015

C++ Program to concept of parameterize constructor

ad+1

Program -

#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

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates