UMBC | CMSC104 |
You can declare and initialize the array in following manner:
char month[ 13 ][ 10 ] = { "", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
When passing a two-dimensional array to a function, the header will look like this:
#includeint main( void ) { char myName[ 25 ] = "Gary Burt"; printf( ">%30s<\n", myName ); printf( ">%-30s<\n", myName ); return 0; }
> Gary Burt< >Gary Burt <
Enter the sales for January : 100498.50 Enter the sales for February : 498.50 Enter the sales for March : 99006.03 Enter the sales for April : 898.23 Enter the sales for May : 10022.34 Enter the sales for June : 25432.75 Enter the sales for July : 36498.23 Enter the sales for August : 44853.43 Enter the sales for September: 75002.99 Enter the sales for October : 44325.82 Enter the sales for November : 23375.07 Enter the sales for December : 87869.81
Highest Sales were in January:
Lowest Sales were in February
Average Sales were 12345.67:
January : 100498.50
February : 498.50
March : 99006.03
April : 898.23
May : 10022.34
June : 25432.75
July : 36498.23
August : 44853.43
September : 75002.99
October : 44325.82
November : 23375.07
December : 87869.81
/*****************************************************/ /* Program Header Block */ /* Filename: 6789prj5.c */ /* Name: Ima Student */ /* SSAN: 6789 */ /* Date: 6 May 2003 */ /* Course/section: CMSC-104 */ /* Description: */ /* Analysis: */ /* Input: */ /* Output: */ /* Constraints: */ /* Formulas: */ /* Assumptions: */ /* Design: */ /* (Your psuedocode goes here.) */ /* */ /* Notes: (As needed.) */ /*****************************************************/
/*********************************************************** * Function name: function_name * * Description: (Your function psuedocode goes here) * * Input Parameters: Name and data type of each parameter. * * Return Value: Data type and description of what * * the return value is. * ***********************************************************/
UMBC CMSC104 | CSEE | CMSC104 | Lectures |