Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Saturday, February 23, 2019

C Program for Year Conversion program by G Krishna Chauhan

#include<stdio.h>
#include<conio.h>

void main()
{
   int in_days, years, months, days, flag;
   printf("Enter number of days : ");
   scanf("%d", &in_days);
   years = in_days/365;
   flag = in_days%365;
   months = flag/30;
   days = flag%30;
   printf("%d days is same as %d years + %d months + %d days", in_days, years, months, days);

getch();
}

No comments:

Post a Comment