Thursday, February 1, 2024

C Language - Write a program to compute the seconds from a given age.

 

Question: Write a program to compute the seconds from a given age.

Solution : C Language

#include <stdio.h>
#include <conio.h>
void main()
{
            long unsigned age,sec;
            clrscr();
            printf("\nENTER YOUR AGE: ");
            scanf("%lu",&age);
            sec=age*365*24*60*60;
            printf("\nAGE IN SECONDS: %lu",sec);
            getch();
}
 

No comments: