Write A Program To Convert BS (Bikram Sammat ) to AD ( C++ )

Write A Program To Convert BS (Bikram Sammat ) to AD
BS is a Nepali Date and AD  Is English Date

#include<iostream.h>
#include<conio.h>
 class convert
 {
  public:
  int y,m,d;
  void enterdate()
  {
  cout <<"enter date in nepali";
  cin>>y>>m>>d;
  }
  };
 void main()
 {
 clrscr();
 convert a,b;
 a.enterdate();
 b.y=a.y-57;
 b.m=a.m-3;
 b.d=a.d-17;
 if(b.d<1)
 {
 b.m=b.m-1;
 b.d=b.d+30;
 }
 if(b.m<1);
 {
 b.y=b.y-1;
 b.m=b.m+12;
 }
 cout<<b.y<<"/"<<b.m<<"/"<<b.d;
 getch();
 }


No comments:

Post a Comment

its cool