#include <stdio.h>
int main()
{
int minutes=0;
double days=0.0;
double years=0.0;
printf("enter minutes ");
scanf("%d ",&minutes);
days= (minutes/60)/24;
years=days/365;
printf("no of minutes %d equals no of days are %f , no of years are %f \n",minutes,days,years);
return 0;
}
During output we have to enter a value two times for program to work, while I used scanf
only one time.
Also the value of days
is being truncated to integer even though I defined it as double
.