Social Icons

Saturday, 15 February 2014

Program to Convert given number of days into years,weeks and days

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

void main()
{
clrscr();
int y,d,w;

cout<<"\n Enter Number of days : ";
cin>>d;

y=d/365;
d=d%365;
w=d/7;
d=d%7;

cout<<"\n Years : "<<y<<"\n Weeks : "<<w<<"\n Days : "<<d;
getch();
}


                                                            Output

No comments:

Post a Comment