Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++

include<iostream>
class Date 
{
	public:
	int Month;
	int Day;
	int Year;
	void SetDate(int nDay,int nMonth,int nYear)
{
Day='nDAY';
Month= nMonth;
Year= nYear;
}
void ShowDate()
{
void ShowDate()
     cout<<"Day of Birth:"<<Day<<endl;
     cout<<"Month of birth:"<<Month<<endl;
     cout<<"Year of birth:"<<Year;
}
};
int main()
{
	 Date d1;//Object creation
	 d1.SetDate(21,07,2010);//call to SetDate function
     d1.ShowDate();//call to ShowDate function
     d1.ShowDate();//call to ShowDate function
getch();
return 0;

}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+2 =