Program to convert BS ( Nepali Date ) To AD Using C++

#include<iostream.h>
 #include<conio.h> 
class convert 

 public: int y,m,d; 
void getdate()
 { 
cout<<" enter the date in BS";
 cin>>y>>m>>d;
 } };
 void main() 
{
 clrscr(); 
convert bs,ad; 
 bs.getdate();
 ad.y=bs.y-56; 
ad.m=bs.m-8;
 ad.d=bs.d-17;
                 

if(ad.d<1) 
{
ad.m=ad.m-1; 
ad.d=ad.d+30;
 } 

if(a.d<1) {
 ad.y=ad.y-1;
 ad.y=ad.m+12; 
 }
 cout<<"the date in AD is "<<ad.y<<"|"<<ad.m<<"|"<<ad.d; getch(); 
 }

No comments:

Post a Comment

its cool