Mail Archives: djgpp/2001/01/25/22:51:43.1
From: | "Michelle" <michelleannprince AT hotmail DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | switchhelp
|
Lines: | 50
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.50.4133.2400
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4133.2400
|
Message-ID: | <Lk6c6.211$fD1.60063@sapphire.mtt.net>
|
Date: | Fri, 26 Jan 2001 03:40:27 GMT
|
NNTP-Posting-Host: | 142.177.233.16
|
X-Complaints-To: | abuse AT mpoweredpc DOT net
|
X-Trace: | sapphire.mtt.net 980480427 142.177.233.16 (Thu, 25 Jan 2001 23:40:27 AST)
|
NNTP-Posting-Date: | Thu, 25 Jan 2001 23:40:27 AST
|
Organization: | MPowered-Subscriber
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
#include <iostream.h>
#include <conio.h>
int main()
{
int month;
int days = 0;
clrscr ();
cout << "This program will tell you the # of days in any given month" <<
endl;
cout << "Enter the mouth number you wish to know for # of day for:" << endl;
cin >> month;
enum monthnums {Jan = 1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov,
Dec };
switch(month)
{
case Jan:
case Mar:
case May:
case Jul:
case Aug:
case Oct:
case Dec:
days = 31;
break;
case Apr:
case Jun:
case Sep:
case Nov:
days = 30;
break;
case 2:
days = 28;
break;
default:
cout << "The # of days in a month is " << month << endl;
break;
}
return 0;
}
I can't get this program to work will someone help me!
- Raw text -