Thursday, September 24, 2020

TODAY'S C PROGRAM

Q1.Write a C program to covert days to days,week and year ?
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
main()
{
 int nodays,years,weeks,days;
 printf("Enter the total days\n");
 scanf("%d",&nodays);
 years=nodays/365;
 weeks=(nodays%365)/7;
 days=(nodays%365)%7;
 printf("%d = %d years,%d weeks,%d        days\n",nodays,years,weeks,days);
}

    
   

No comments:

Post a Comment

MY MARS DREAM 2021