Have a Read!

Hi Everyone.
The idea for this page is to provide new c users simple c tutorials to learn how to develop the logic and more importantly correct way to write syntax.
ENJOY !!!

Thursday, January 27, 2011

C PROGRAM FOR CONVERTING NUMBER TO YEARS WEEKS & DAYS

#include<stdio.h>
int main () {
int number,years,weeks,days;
printf("ENTER THE NUMBER\n");
scanf("%d",&number);
years=number/365;
weeks=(number-(years*365))/7;
days=(number-(years*365)-(weeks*7));
printf("\nYEARS=%d\nWEEKS=%d\nDays=%d\n",years,weeks,days);
return 0;
}

No comments:

Post a Comment

Related Posts with Thumbnails