www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/22/19:37:51

From: "Michelle" <michelleannprince AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: switch statements
Lines: 23
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: <Re4b6.194$LQ1.55146@sapphire.mtt.net>
Date: Tue, 23 Jan 2001 00:28:33 GMT
NNTP-Posting-Host: 142.177.228.249
X-Complaints-To: abuse AT mpoweredpc DOT net
X-Trace: sapphire.mtt.net 980209713 142.177.228.249 (Mon, 22 Jan 2001 20:28:33 AST)
NNTP-Posting-Date: Mon, 22 Jan 2001 20:28:33 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

How would you write a program that contains a "switch" statement that
determines how many days are in a particular month as follows:

·        The user enters a month number (int) where 1 means January, 2 means
February, etc.

·        The program then outputs the number of days in that month.

·        Assume the following numbers of days per month:

31 days for January, March, May, July, August, October, December

30 day for April, June, September, November

28 days for February








- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019