Pages

Tuesday, February 17, 2015

C Program to Convert given no of days into years weeks and days

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

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

cout<<"Enter No. of days:";
cin>>d;

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

cout<<"
Years: "<<y<<"
Weeks: "<<w<<"
Days: "<<d;

getch();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.