/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::: THIS PROGRAMM EVALUTE THE CONCEPT OF DEFAULT ARTGUMENTS ::::
:::: IN MEMBER FUNCTION C++ PROGRAMMING LANGUAGE ::::
:::: DEVLOPED BY DX PANCHAL AT GROW MORE M.C.A. LAB ::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/
// HEADER FILE DECLARATION
#include<iostream.h>
#include<conio.h>
#include<dos.h>
//CLASS TEST DECLARATION
class test
{
int a,b,ans;
public:
void setcode(int m,int n=10)
{
a=m;
b=n;
ans=a+b;
cout<<"\n\n\t\tVALUE OF A+B = "<<ans;
};
};
// END OF CLASS TEST
// MAIN FUNCTION SECTION
void main()
{
clrscr();
test t1;
t1.setcode(15); //TAKES DEFAULT VALUE
t1.setcode(20); //TAKES DEFAULT VALUE
t1.setcode(25,5);//GIVES VALUE TO THE FUNCTION
getch();
}
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::: THIS PROGRAMM EVALUTE THE CONCEPT OF DEFAULT ARTGUMENTS ::::
:::: IN MEMBER FUNCTION C++ PROGRAMMING LANGUAGE ::::
:::: DEVLOPED BY DX PANCHAL AT GROW MORE M.C.A. LAB ::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/
// HEADER FILE DECLARATION
#include<iostream.h>
#include<conio.h>
#include<dos.h>
//CLASS TEST DECLARATION
class test
{
int a,b,ans;
public:
void setcode(int m,int n=10)
{
a=m;
b=n;
ans=a+b;
cout<<"\n\n\t\tVALUE OF A+B = "<<ans;
};
};
// END OF CLASS TEST
// MAIN FUNCTION SECTION
void main()
{
clrscr();
test t1;
t1.setcode(15); //TAKES DEFAULT VALUE
t1.setcode(20); //TAKES DEFAULT VALUE
t1.setcode(25,5);//GIVES VALUE TO THE FUNCTION
getch();
}
No comments:
Post a Comment