Advertisement

C Programming


C programming
A program to calculate days, months & year.You have to enter days.Suppose you enter days=365.This will be calculate as
year=1.
Months=12
Days =0

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{       clrscr();
                int n,day,month,yr,x;
                printf("Enter days=");
                scanf("%d",&n);
                yr=n/365;
                x=n%365;
                printf("Output yr=%d",yr);
                month=n/30;
                printf("\noutput monthes=%d",month);
                day=x%30;
                printf("\noutput days=%d",day);
                getch();
                                   }

No comments:

Post a Comment

Please comment bellow. Share your knowledge