C program calculate seconds from days

This program calculates the number of days in a given date. This is a part of Mumbai University MCA Colleges C programs MCA Sem 1


#include<stdio.h>
#include<conio.h>
void main()
{
int y,m,d;
long float sec,total;
clrscr();
printf("Enter the year");
scanf("%d",&y);
printf("Enter the month");
scanf("%d",&m);
printf("Enter the days");
scanf("%d",&d);
total=(365*y)+(30*m)+d;
sec=total*24*60*60;

printf("The number of seconds is %lf",sec);
getch();
}


Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

No comments:

Post a comment