c++ program, write a program in which the user enters any date and the computer displays the day?
338128
#include<iostream.h>\n#define isleapyear(year) ((!(year % 4) && (year % 100)) || (!(year % 400) && (year % 1000)))\n\nclass Date\n{\nprivate:\nint  month, day, year;\n \npublic:\nDate(int month,int day,int year):month(month),day(day),year(year){};\nint isdatevalid();\nint weekday();\n\n};\n\n//\n//   return 1 if date is valid, 0 otherwise.\n//\nint Date::isdatevalid()\n{\n  if (day <= 0) return 0 ;\n  switch( month )\n{\n  case 1  :\n  case 3  :\n  case 5  :\n  case 7  :\n  case 8  :\n   case 10 :\n  case 12 : if (day > 31) return 0 ; else return 1 ;\n  case 4  :\n  case 6  :\n  case 9  :\n  case 11 : if (day > 30) return 0 ; else return 1 ;\n  case 2  : \n    if ( day > 29 ) return 0 ;\n      if ( day < 29 ) return 1 ;\n      if (isleapyear(year)) return 1 ;   // leap year\n    else return 0 ;\n}\n  return 0 ;\n}\n\n//\n// given month, day, year, returns day of week, eg. Monday = 0 etc.\n// tested for 1901 to 2099 (seems to work from 1800 on too)\n// \nint Date::weekday()\n{\n  int ix, tx, vx;\n \n  switch (month) {\n    case 2  :\ncase 6  : vx = 0; break;\ncase 8  : vx = 4; break;\ncase 10 : vx = 8; break;\ncase 9  :\ncase 12 : vx = 12; break;\ncase 3  :\ncase 11 : vx = 16; break;\ncase 1  :\ncase 5  : vx = 20; break;\ncase 4  :\ncase 7  : vx = 24; break;\n  }\n  if (year > 1900)  // 1900 was not a leap year\n    year -= 1900;\n  ix = ((year - 21) % 28) + vx + (month > 2);  // take care of February \n  tx = (ix + (ix / 4)) % 7 + day;              // take care of leap year\n  return (tx % 7);\n}\n \n \nint main()\n{\n  char week[7][10] = {\n  "Monday","Tuesday","Wednesday","Thursday",\n"Friday","Saturday","Sunday"\n};\n  Date *d;\n  int  month, day, year;\n  cout<<"Return the day of the week given the date."<<endl;\n  cout<<"Enter date in the form mm/dd/yyyy : ";\n  scanf("%d/%d/%d",&month,&day,&year);\n  d = new Date(month,day,year);\n  if (d->isdatevalid())\n  {\n    cout<<"The day of the week for this date is "<<week[d->weekday()]<<endl;\n  }\n  else\n    printf("%d/%d/%d not a valid date!",  month,day,year);\n  \n  getchar();   // wait \n  getchar();   // 2nd wait needed\n  return 0;\n}
345718
int main (void)\n{\nint a,rem\ncout<<"enter the number";\n<<cin a;\nrem=a/a;\nif(rem>0)\ncout<<"its integer";\nelse\ncout<<"not a integer";\nreturn 0;\n}
678911
Check out the site at http://www.pscode.com - I don't do C++ but I use that site all the time for Visual BASIC stuff I work on.
295968
It works only for numbers *directly*, but through simple use of an array, you can make it work with almost anything.\n\nFor instance, if you want a random day of the week, consider the following code snippet:\n\nconst char *Days[7] =\n{\n"mon","tue","wed","thu","fri","sat","sun"\n};\n\nThe expression Days[rand () % 7] will return one of the above strings at random.\n\nThe secret here is to use an array as a mechanism to translate a number into a string.
496785
Go to Microsoft"s home page.  They have a free C++ and a Visual basic compliler under free software.
272231
You can format the output of cout like this:\ncout << setprecision(2) << yourVar << endl;\n\nAnd if you want it to show the decimal even when it is .00, use cout << fixed << ...\n\nAnd while we're at it, if you want to make your output even prettier, you might want to make use of setw(), setfill(), and left/right...\n\nOh, and to use any of those, you need to #include <iomanip>
346423
check out http://www.planet-source-code.com - I don't do C++, but I use that site all the time, and it has great examples in source code form.
719717
* Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
657053
You can use Microsoft Access or Excel to do that.\n\nAlso you can use Active Desktop Calendar.
635623
I don't know C++. But You can do it by sending  the text in to prn folder. Same thig you can do it in DOS type a.txt >prn
765887
Assuming your above program works, which I don't think it will because your doing an aggregate operation on an array..you should assign values to indexes in the array...eg cin >> Date[0] or use a for loop or something...regardless since your putting everything in an array anyway simply do something like using a counter variable, personally i think it would be the easiest way of doing something like that.\n\nint counter = 0;\n\ncout << enter day to subtract << endl;\ncin   >> counter;\ncout << Date[1]  - Date[counter] << endl;\n\nI belive using
1178612
Well.... That's too Hard to find... i'm poor at C++...... So can't help.. have good day! Search in Google
521100
Use the Calendar class:\n\nhttp://java.sun.com/j2se/1.3/docs/api/java/util/Calendar.html
505044
Try Planet Source Code:\n\nhttp://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3270&lngWId=3\n\nThis one's in C++, but you should be able to convert it back to C...
79546
second, hour, day, month, year
919273
Hi,\n\nYou can trick the program by changing the date on your computer a few days back.\nIf it works, and you don't want to keep canging the date on your computer send me an e-mail. I'll give you a small program  that tricks your software into believing it's another date than your computer's.
599947
http://www.google.com/calendar\n\nIf you really want it to pop up when you start your machine, place a shortcut in your startup folder.