I am a begginer , I have solved a question for converting Total days into years Weeks and days. The programme is compiled runs ok but result I get every time wrong.
the code is like this
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int yrs, wks, days, tot ,num;
yrs= tot/365;
num= tot-(yrs*365);
wks= (num/7);
days = num-(wks*7);
cout<< "Enter count of days\n";
cin >> tot;
cout<< "this means\n"<<yrs<<" years\n"<<wks<<" weeks\n"<<days<<" Days" ;
return 0 ;
}
When I give number of days as 365 i get 24442 yrs 30weeks 4days
The result I get is same every time whatever days I give.
Regards
Arora SK
Dear Sir,
I had been struggling hard to find a reason.
I salute you for the prompt, correct and to the point reply, which has solved my problem.
May God Bless You!
Regards
Arora