Saturday, December 31, 2011

Find month and days of given days in 'C'

Example



#include<stdio.h>
#include<conio.h>
void main()
{
int mth,day,d1;
clrscr();
printf("Enter days of your choice:");
scanf("%d",&d1);
day=d1%30;
mth=d1/30;
printf("\n========DAYS && MONTH==========\n");
printf("\nMonth =%d",mth);
printf("\nDays  =%d",day);
getch();
}
/*=====================================================================
OUTPUT
Enter days of your choice:35


========DAYS && MONTH==========


Month =1
Days  =5  */

No comments:

Post a Comment