google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to convert days into years months and days in c. - 2nd puc computer science

Write a program to convert days into years months and days in c.

 Write a program to convert days into years months and days in c.

#include<stdio.h>

#include<conio.h>

void main()

{

int nodays,days,years,months;

clrscr();

printf("Enter the total days: ");

scanf("%d",&days);

nodays=days;

years=days/365;

days=days%365;

months=days/30;

days=days%30;

printf("%d days= %d years-%d months-%d days",nodays,years,months,days);

getch();

}

Output:

Enter the total days: 1000

1000 days= 2 years-9 months-0 days

Write a program to convert days into years months and days in c.  Write a program to convert days into years months and days in c. Reviewed by Vision Academy on December 07, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.