Skip to content

Instantly share code, notes, and snippets.

@btechmag
Created April 15, 2021 12:06
Show Gist options
  • Save btechmag/0240d0535754914dcf48b314b7dd52ae to your computer and use it in GitHub Desktop.
Save btechmag/0240d0535754914dcf48b314b7dd52ae to your computer and use it in GitHub Desktop.
C program to convert specified days into years , weeks and days.
#include<stdio.h>
int main()
{
int days,weeks,years;
days=1329;
years=(days/365);
printf("\n years:%d \n",years);
weeks=(days%365)/7;
printf("\n weeks:%d \n",weeks);
days=days-((years365)+(weeks7));
printf("\n days:%d \n",days);
getch();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment