netoops blog

Saturday, 24 August 2013

First_Day_Of_Year

#include <stdio.h>
#include <conio.h>

void main()
{
 int yr,ldays,day;
 long int ndays,tdays;
 clrscr();
 printf("Enter any Year");
 scanf("%d",&yr);
 ndays=(yr-1)*365L;
 ldays=(yr-1)/4+(yr-1)/400-(yr-1)/100;
 tdays=ndays+ldays;
 day=tdays % 7;

 switch(day)
 {
  case 0: printf("Monday");
break;
  case 1: printf("Tuesday");
break;
  case 2: printf("Wednesday");
break;
  case 3: printf("Thrsday");
break;
  case 4: printf("Friday");
break;
  case 5: printf("Saturday");
break;
  case 6: printf("Sunday");
 }
 getch();
}


Tech Knowledege
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments :

Post a Comment

 
Subscribe For Free Updates!

We'll not spam mate! We promise.

Become Our Fan on Social Sites!