#include<iostream.h>
#include<conio.h>
class set
{
int m, n;
public:
void input(void);
void display(void);
int largest(void);
};
int set :: largest (void)
{
if (m>=n)
return(m);
else
return(n);
}
void set :: input (void)
{
cout<<"Input values of m and n : ";
cin>>m>>n;
}
void set :: display (void)
{
cout<<" Largest value = "
<<largest( ) <<"\n"; // calling member function
}
void main( )
{
set A;
A.input( );
A.display( );
getch( );
}
3 comments:
i hav done the same program as shown above but still i m getting errors
set::largest is not a member of 'set'.
set:: largest cannot return a value.
these r the errors whch i m getting
pls reply me soon its very muchh needed for me as my exams are on my head
Post a Comment