Days calculator

C program to calculate month and days :

code

#include<stdio.h>
#include<conio.h>
void main()
{
int month,rem_day,total_day;
clrscr();
printf(“Enter total days to calculate month & remaining days :”);
scanf(“%d”,&total_day);
month=total_day/30;
rem_day=total_day%30;
printf(“\nTotal month :%d”,month);
printf(“\nTotal days :%d”,rem_day);
getch();

}

 


output

Enter total days to calculate month & remaining days : 365

Total month :12

total days :5

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s