C++ Programs - Birthday numerology

C++ Programs on birthday numerology

#include <iostream>
using namespace std;
int add1(int z);
int numer(int &dd, int &mm , int yyyy=2000)
{
     int n1,n2;
     if(mm<10)
     n1=yyyy+(10000*mm)+(100000*dd);
     else
     n1=yyyy+(mm*10000)+(dd*1000000);
     n2 = add1(n1);
     return n2;
}
      int add1(int z)
      {

      int sum=0,remainder;
      while(z!=0)
      {
      remainder = z % 10;
      sum = sum + remainder;
      z = z / 10;
      }
    return sum;
}
int main()
{
   int d,m,y=0,n1,sum2=0,sum3=0,s;
   cout<<" \n Enter your date of birth in the form dd-mm-yyyy"<<endl;
   cout<<"\nEnter the date - dd"<<endl;
   cin>>d;
   cout<<"\nEnter the month - mm"<<endl;
   cin>>m;
   cout<<"\nEnter the year - yyyy"<<endl;
   cin>>y;
   if(y == 0)
   {
   cout<<" \n The default year is been taken as 2000"<<endl;
   s=numer(d,m);
   }
   else
   s=numer(d,m,y);

   cout<<"\nSum of digits of entered number = "<<s<<endl;

  if((s>=0)&&(s<=9))
  cout<<"\nSum of digits of entered number in single digit is= "<<s;

  else
 {
    sum2=add1(s);

      if((sum2>=0)&&(sum2<=9))
      cout<<"\nSum of digits of entered number in single digit is= "<<sum2;
      else
      {
      sum3=add1(sum2);

      cout<<"\nSum of digits of entered number in single digit is=" <<sum3;
     }
}
  return 0;


}