3 Structured Program Development in C: Solutions
SOLUTIONS 3.11
Identify and correct the errors in each of the following [ Note: There may be more than one error in each piece of code]: a) if ( age >= 65 ); printf( "Age is greater than or equal to 65\n" ); else printf( "Age is less than 65\n" ); ANS: if ( age >= 65 ) /* ; removed */ printf( “Age is greater than or equal to 65\n” ); else printf( “Age is less than 65\n” ); b) int x = 1, total; while ( x <= 10 ) { total += x; ++x; } ANS: int x = 1, total = 0; while ( x <= 10 ) { total += x; ++x; } c) While ( x <= 100 ) total += x; ++x; ANS: while ( x <= 100 ) { total += x; ++x; } d) while ( y > 0 ) { printf( "%d\n" "%d\n", , y ); ++y; } © Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
20
Structured Program Development in C: Solutions
Chapter 3
ANS: while ( y > 0 ) { printf( “%d\n” “%d\n”, , y ); --y; } 3.12
3.13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Fill in the blanks in each of the following: a) The solution solution to any problem problem involves involves performing performing a series series of actions actions in a specific specific . ANS: order. b) A synonym synonym for proce procedure dure is . ANS: algorithm c) A variable variable that accumula accumulates tes the sum of several several numbers numbers is a . ANS: total. d) The process of setting certain variables to specific values at the beginning of a program is called . ANS: initialization. e) A special special value value used to indicate indicate “end of data entry” is called called a , a , a or a value. ANS: sentinel value, dummy value, signal value, flag value. f) A is a graphical graphical representa representation tion of an algorithm. algorithm. ANS: flowchart. g) In a flowchart, flowchart, the order in which the steps should be performed performed is indicated indicated by symbols. symbols. ANS: arrow (flowline). h) The terminatio termination n symbol indicates indicates the and of every algorithm. algorithm. ANS: beginning, end. i) Rectangle symbols correspond to calculations that are normally performed by statements and input/output oper operat atio ions ns that that are are norm normal ally ly perf perfor orme med d by call callss to the the and and stan standa dard rd libr libraary func functi tion ons. s. ANS: assignment, printf, scanf. j) The item written written inside a decision decision symbol is called a . ANS: condition. What does the following program print? #include int main() { int x = 1, total = 0, y; while ( x <= 10 ) { y = x * x; printf( "%d\n" "%d\n", , y ); total += y; ++x; } printf("Total printf("Total is %d\n", %d\n", total); return 0; }
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Chapter 3
Structured Program Development in C: Solutions 21
1 4 9 16 25 36 49 64 81 100 Total is 385
3.14
Write a single pseudocode statement that indicates each of the following: a) Disp Displa lay y the the mess messag agee "Enter two numbers" . ANS: print “enter “enter two numbers” b) Assign Assign the the sum sum of varia variable bless x, y, and z to variable p. ANS: p = x + y + y + z c) The followin following g conditio condition n is to be tested tested in in an if…else selection statement: statement: The current value of variable m is greater than twice the current value of variable v. ANS: if m is greater than twice v do this ... else do this ... d) Obtain Obtain valu values es for for variabl variables es s, r, and t from the keyboard. ANS: input s , input r , input t
3.15
Formulate a pseudocode algorithm for each of the following: a) Obtain two numbers from the keyboard, compute the sum of the numbers and display the result. ANS: Input the first number number Input the second number number Add the two numbers numbers Output the sum b) Obtain two numbers numbers from the keyboard, keyboard, and determine and display which which (if either) either) is the larger of the the two numbers. ANS: Input the first number number from the the keyboard keyboard Input the second number number from from the keyboard keyboard If the first number is greater than the second second number number print it Else if the second number number is greater greater than than the first number print it Else print a message message stating stating that the the numbers numbers are equal equal c) Obtain a series of positive numbers from the keyboard, and and determine and display the sum of the numbers. Assume Assume that the user types the sentinel value -1 to indicate “end of data entry.” ANS: Input a value value from the keyboard keyboard While the input value is not equal to -1 add the number to the running total
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
22
Structured Program Development in C: Solutions
Chapter 3
ANS: False. The algorithm is the hardest of solving a problem. b) A sentinel value must be a value that cannot be confused with a legitimate legitimate data value. value. ANS: True. c) Flowlines Flowlines indicat indicatee the action actionss to be performe performed. d. ANS: False. Flowlines indicate the order in which steps are performed. d) Conditions written inside decision decision symbols always contain contain arithmetic arithmetic operators operators (i.e., +, -, *, /, and %). ANS: False. They normally contain conditional operators. e) In top-down, stepwise stepwise refinement, refinement, each refinement is is a complete representation representation of the algorithm. algorithm. ANS: True. For Exercises 3.17 to 3.21, perform each of these steps:
1. Read the problem problem state statement. ment. 2. Formulate the algorithm using pseudocode and top-down, stepwise refinement. 3. Writ Writee a C prog progra ram. m. 4. Test, Test, debug, debug, and execut executee the C program program.. 3.17
Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording miles driven and gallons used for each tankful. Develop a program that will input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful. After processing all input information, the program should calculate and print the combined miles per gallon obtained for all tankfuls. Here is a sample input/output dialog:.
Enter the gallons used (-1 to end): 12.8 Enter the miles driven: 287 The miles / gallon for this tank was 22.421875 Enter the gallons used (-1 to end): 10.3 Enter the miles driven: 200 The miles / gallon for this tank was 19.417475 Enter the gallons used (-1 to end): 5 Enter the miles driven: 120 The miles / gallon for this tank was 24.000000 Enter the gallons used (-1 to end): -1 The overall average miles/gallon miles/gallon was 21.601423
ANS: 2)
Top: Determine the average miles/gall Determine miles/gallon on for each tank tank of gas, and and the overall miles/ga miles/gallon llon for for an arbitrary number of tanks of gas First refinement: Initialize variables variables Input the gallons used used and the the miles driven, driven, and calculat calculatee and print print the miles/gallon miles/gallon for each tank tank of gas. gas. Keep track of the total miles and the total gallons. Calculate and print the overall average miles/gallon.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 23
Chapter 3
While the sentinel value (-1) has not been entered for the gallons Add gallons gallons to the running total in totalGal totalGallons lons Input the miles driven driven for the current tank tank Add miles to the running running total total in totalMiles totalMiles Calculate and print the miles/gallon Input the gallons used used for the next tank tank Set totalAverage to totalMiles divided by totalGallons. print the the average miles/gall miles/gallon on
3) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
/* Exercise 3.17 Solution */ #include int main() { double gallons; double miles; double totalGallons totalGallons = 0.0 0.0; ; double totalMiles = 0.0 0.0; ; double totalAverage;
/* /* /* /* /*
gallons used for current tank*/ miles driven for current tank*/ total gallons used */ total miles driven */ average miles/gallon */
/* get gallons used for first tank */ printf( "Enter the gallons used ( -1 to end): " ); scanf( "%lf" "%lf", , &gallons ); /* loop until sentinel value read from user */ while ( gallons != -1.0 ) { totalGallons += gallons; /* add current tank gallons to total */ printf( "Enter the miles driven: " ); /* get miles driven */ scanf( "%lf" "%lf", , &miles ); totalMiles += miles; /* add current tank miles to total */ /* display miles per gallon for current tank */ printf( "The Miles / Gallon for this tank was %f\n\n", %f\n\n", miles / gallons ); /* get next tank's gallons */ printf( "Enter the gallons used ( -1 to end ): " ); scanf( "%lf" "%lf", , &gallons ); } /* end while */ /* calculate average miles per gallon over all tanks */ totalAverage = totalMiles / totalGallons; printf( "\nThe overall average Miles/Gallon was %f\n", %f\n", totalAverage ); return 0; /* indicate successful termination */ } /* end main */
3.18
Develop a C program that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available: 1. Acco Account unt numbe numberr
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
24
Structured Program Development in C: Solutions
Chapter 3
The program should input each of these facts, calculate the new balance ( = beginning balance + charges – credits ), and determine if the new balance exceeds the customer's credit limit. For those customers whose credit limit is exceeded, the program should display the customer's account number, credit limit, new balance and the message “Credit limit exceeded.” exceeded.” Here is a sample input/ output dialog:
Enter account number ( -1 to end): 100 Enter beginning balance: 5394.78 Enter total charges: 1000.00 Enter total credits: 500.00 Enter credit limit: 5500.00 Account: 100 Credit limit: 5500.00 Balance: 5894.78 Credit Limit Exceeded. Enter Enter Enter Enter Enter
account number ( -1 to end ): 200 beginning balance: 1000.00 total charges: 123.45 total credits: 321.00 credit limit: 1500.00
Enter Enter Enter Enter Enter
account number ( -1 to end ): 300 beginning balance: 500.00 total charges: 274.73 total credits: 100.00 credit limit: 800.00
Enter account number ( -1 to end ): -1
ANS: 2)
Top: Determine if Determine if each each of an an arbitrary arbitrary number of department department store custome customers rs has has exceeded exceeded the credit limit on a charge charge account. First refinement: Input the account number, beginning balance, total charges, charges, total total credits, and and credit credit limit for a customer customer,, calcu late the customer’s new balance and determine if the balance exceeds the credit limit. Then process the next customer. Second refinement: Input the first customer’s customer’s account account number. number. While the sentinel value (-1) has not been entered for the account number Input the customer’s beginning balance Input the customer’s total total charges charges Input the customer’s total total credits credits Input the customer’s credit credit limit limit Calculate the customer’s new balance If the balance balance exceeds exceeds the credit credit limit Print the account number
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 25
Chapter 3
3) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/* Exercise 3.18 Solution */ #include int main() { int accountNumber; double balance; double charges; double credits; double limit;
/* /* /* /* /*
current current current current current
account's account's account's account's account's
number */ starting balance */ total charges */ total credits */ credit limit */
/* get account number */ printf( "\nEnter account number ( -1 to end): " ); scanf( "%d" "%d", , &accountNumber ); /* loop until sentinel value read from user */ while ( accountNumber != -1 ) { printf( "Enter beginning balance: " ); scanf( "%lf" "%lf", , &balance ); printf( "Enter total charges: " ); scanf( "%lf" "%lf", , &charges ); printf( "Enter total credits: " ); scanf( "%lf" "%lf", , &credits ); printf( "Enter credit limit: " ); scanf( "%lf" "%lf", , &limit ); balance += charges - credits; /* calculate balance */ /* if balance is over limit, display account number with credit limit and balance to two digits of precision */ if ( balance > limit ) { printf( "%s%d\n%s%.2f\n%s%.2f\n%s\n", "Account: ", accountNumber, ", accountNumber, "Credit limit: ", ", limit, "Balance: ", balance, "Credit Limit Exceeded." ); ", } /* end if */ /* prompt for next account */ printf(
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
26
Structured Program Development in C: Solutions
Chapter 3
3.19
One large chemical company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a program that will input each salesperson's gross sales for last week and will calculate and display that salesperson's earnings. Process one salesperson's figures at a time. Here is a sample input/output dialog: Enter sales in dollars ( -1 to end): 5000.00 Salary is: $650.00 Enter sales in dollars ( -1 to end ): 1234.56 Salary is: $311.11 Enter sales in dollars ( -1 to end ): 1088.89 Salary is: $298.00 Enter sales in dollars ( -1 to end ): -1
ANS: 2)
Top: For an arbitrary number of salespeople, determine each salesperson’s earnings for the last week. First refinement: Input the salesperson’s salesperson’s sales for the week, calculate and print the salesperson’s salesperson’s wages for the the week, week, then process the next salesperson. Second refinement: Input the first salesperson’s salesperson’s sales sales in dollars. dollars. While the sentinel value (-1) has not been entered for the sales Calculate the salesperson’s wages for the week Print the salesperson’s wages for the week Input the next salesperson’s salesperson’s sales sales in dollars dollars
3) 1 2 3 4 5 6 7 8
/* Exercise 3.19 Solution */ #include int main() { double sales; /* gross weekly sales */ double wage; /* commissioned earnings */
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 27
Chapter 3
3.20
The simple interest on a loan is calculated by the formula interest = principal * rate * days / 365 365; ;
The preceding formula assumes that rate is the annual interest rate, and therefore includes the division by 365 (days). Develop a program that will input principal , rate and days for several loans, and will calculate and display the simple interest for each loan, using the preceding formula. Here is a sample input/output dialog:
Enter loan principal ( -1 to end): 1000.00 Enter interest rate: .1 Enter term of the loan in days: 365 The interest charge is $100.00 Enter loan principal ( -1 to end ): 1000.00 Enter interest rate: .08375 Enter term of the loan in days: 224 The interest charge is $51.40 Enter loan principal ( -1 to end ): 10000.00 Enter interest rate: .09 Enter term of the loan in days: 1460 The interest charge is $3600.00 Enter loan principal ( -1 to end ): -1
ANS: 2)
Top: For an arbitrary number of loans determine the simple interest for each loan. First refinement: Input the principal of the loan, loan, the interest interest rate, and the term of the loan, calculate calculate and and print the the simple interest for the loan, loan, and process process the next loan. loan. Second refinement: input the first loan principal in dollars. While the sentinel value (-1) has not been entered for the loan principal Input the interest rate rate Input the term of the loan in days days Calculate the simple interest for the loan Print the simple interest for the loan
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
28
Structured Program Development in C: Solutions
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
Chapter 3
/* loop until sentinel value is read from user */ while ( principal != -1.0 ) { printf( "Enter interest rate: " ); /* get rate */ scanf( "%lf" "%lf", , &rate ); printf( "Enter term of the loan in days: " ); /* get term */ scanf( "%d" "%d", , &term ); /* calculate interest charge */ interest = principal * rate * term / 365.0 365.0; ; printf( "The interest charge is $%.2f\n\n", interest ); /* get next loan principal */ printf( "Enter loan principal ( -1 to end ): " ); scanf( "%lf" "%lf", , &principal ); } /* end while */ return 0; /* indicate successful termination */ } /* end main */
3.21
Develop a program that will determine the gross pay f or each of several employees. The company pays “straight-time” for the first 40 hours worked by each employee and pays “time-and-a-half” for all hours worked in excess of 40 hours. You are given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee, and should determine and display the employee's gross pay. Here is a sample input/output dialog:
Enter number of hours worked ( -1 to end Enter hourly rate of the worker ( $00.00 Salary is $390.00
): 39 ): 10.00
Enter number of hours worked ( -1 to end Enter hourly rate of the worker ( $00.00 Salary is $400.00
): 40 ): 10.00
Enter number of hours worked ( -1 to end Enter hourly rate of the worker ( $00.00 Salary is $415.00
): 41 ): 10.00
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 29
Chapter 3
3) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
/* Exercise 3.21 Solution */ #include int main( void ) { double hours; /* total hours worked */ double rate; /* hourly pay rate */ double salary; /* gross pay */ /* get first employee's hours worked */ printf( "Enter number of hours worked ( scanf( "%lf" "%lf", , &hours );
-1 to end
): "
);
/* loop until sentinel value read from user */ while ( hours != -1.0 ) { /* get hourly rate */ printf( "Enter hourly rate of the worker ( scanf( "%lf" "%lf", , &rate );
$00.00
): " );
/* if employee worked less than 40 hours */ if ( hours <= 40 ) { salary = hours * rate; } /* end if */ else { /* compute "time-and-a-half" pay */ salary = 40.0 * rate + ( hours - 40.0 ) * rate * 1.5 1.5; ; } /* end else */ /* display gross pay */ printf( "Salary is $%.2lf\n\n", $%.2lf\n\n", salary /* prompt for next employee's data */ printf( "Enter number of hours worked ( scanf( "%lf" "%lf", , &hours ); } /* end while */
);
-1 to end
return 0; /* indicate successful termination */ } /* end main */
): " );
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
30
13 14 15 16 17 18 19 20
Structured Program Development in C: Solutions
Chapter 3
c = 5; printf( "%d\n", "%d\n", c ); printf( "%d\n" "%d\n", , c-- ); /* postdecrement */ printf( "%d\n\n" "%d\n\n", , c ); return 0; /* indicate successful termination */ } /* end main */
5 4 4 5 5 4
3.23 Write a program that utilizes looping to print the numbers from 1 to 10 side-by-side on the same line with 3 spaces between each number. ANS:
1 2 3 4 5 6
/* Exercise 3.23 Solution */ #include int main() { int i = 0; /* initialize i */
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 31
Chapter 3
While counter is less than or equal to 10 input a new variable into the variable number If number is greater than largest replace largest with number Increment counter Print the value of the largest ( while condition false when counter is 11)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/* Exercise 3.24 Solution */ #include int main() { int counter; /* counter for 10 repetitions */ int number; /* current number input */ int largest; /* largest number found so far */ /* get first number */ printf( "Enter the first number: " ); scanf( "%d" "%d", , &largest ); counter = 2; /* loop 9 more times */ while ( counter <= 10 ) { printf( "Enter next number: " ); /* get next number */ scanf( "%d" "%d", , &number ); /* if current number input is greater than largest number,
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
32
Structured Program Development in C: Solutions
3.25
Chapter 3
Write a program that utilizes looping to print the following table of values:
N
10 * N
1 2 3 4 5 6 7 8 9 10
10 20 30 40 50 60 70 80 90 100
100 * N 100 200 300 400 500 600 700 800 900 1000
1000 * N 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
The tab character, \t, may be used in the printf statement to separate the columns with tabs. ANS: 1 2 3 4 5 6 7 8 9
/* Exercise 3.25 Solution */ #include int main() { int n = 0; /* counter */ /* display table headers */ printf( "\tN\t\t10 * N\t\t100 * N\t\t1000 * N\n\n" );
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 33
Chapter 3
ANS: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/* Exercise 3.26 Solution */ #include int main() { int a = 3; /* counter */ /* display table headers */ printf( "A\tA+2\tA+4\tA+6\n\n" ); /* loop 5 times */ while ( a <= 15 ) { /* calculate and display table values */ printf( "%d\t%d\t%d\t%d\n" "%d\t%d\t%d\t%d\n", , a, a + 2, a + 4, a + 6 ); a += 3; } /* end while */ return 0; /* indicate successful termination */ } /* end main */
3.27 Using an approach similar to Exercise 3.24, find the two largest values of the 10 numbers. [ Note: You may input each number only once.] ANS:
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
34
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
Structured Program Development in C: Solutions
/* if number is between secondLargest and largest */ if ( number > secondLargest ) { secondLargest secondLargest = number; } /* end if */ } /* end else */ ++counter; } /* end while */ /* display largest two numbers */ printf( "Largest is %d\n", %d\n", largest ); printf( "Second largest is %d\n", %d\n", secondLargest ); return 0; /* indicate successful termination */ } /* end main */
Enter the first number: 100 Enter next number: 102 Enter next number: 83 Enter next number: 3883 Enter next number: 328 Enter next number: 28 Enter next number: 839 Enter next number: 2398 Enter next number: 182 Enter next number: 0 Largest is 3883
Chapter 3
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Structured Program Development in C: Solutions 35
Chapter 3
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
/* if result 1, increment passes */ if ( result == 1 ) { ++passes; } /* end if */ else { /* if result is not 1, increment failures */ ++failures; } /* end else */ ++student; } /* end while */ printf( "Passed %d\nFailed %d\n", %d\n", passes, failures ); /* if more than eight students passed, print "raise tuition" */ if ( passes >= 8 ) { printf( "Raise tuition\n" ); } /* end if */
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
36
Structured Program Development in C: Solutions
ANS:
**** ++++++++ **** ++++++++ **** ++++++++ **** ++++++++ **** ++++++++
3.30
What does the following program print?
Chapter 3
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Chapter 3
3.31
Structured Program Development in C: Solutions 37
(Dangling Else Problem) Determine the output for each of the following when x is 9 and y is 11 and when x is 11 and y is 9. Note that the compiler ignores the indentation in a C program. Also, the compiler always associates an else with the previous if unless told to do otherwise by the placement of braces {}. Because, on first glance, the programmer may not be sure which if an else matches, this is referred to as the “dangling else” pr oblem. We have eliminated the indentation from the followin g code to make the problem more challenging. [ Hint: Hint: Apply indentation conventions you have learned.] a) if ( x < 10 ) if ( y > 10 ) printf( "*****\n" ); else printf( "#####\n" ); printf( "$$$$$\n" ); ANS: x = 9, y = 11
***** $$$$$
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
38
Structured Program Development in C: Solutions
a) Assu ssuming x = 5 and y = 8, the following output is produced. @@@@@ $$$$$ &&&&&
ANS: if ( y == 8 ) { if ( x == 5 ) printf( “@@@@@\n” ); else printf( “#####\n” ); printf( “$$$$$\n” ); printf( “&&&&&\n” ); }
Chapter 3
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Chapter 3
Structured Program Development in C: Solutions 39
ANS: if ( y == 8 ) { if ( x == 5 ) printf( “@@@@@\n” ); } else { printf( “#####\n” ); printf( “$$$$$\n” ); printf( “&&&&&\n” ); } 3.33
Write a program that reads in the side of a square and then prints that square out of asterisks. Your program should work for squares of all side sizes between 1 and 20. For example, if your program reads a size of 4, it should print ****
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
40
Structured Program Development in C: Solutions
Chapter 3
Modify the program you wrote in Exercise 3.33 so that it prints a hollow square. For example, if your prog ram reads a size 3.34 of 5, it should print *****
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Chapter 3
3.35
Structured Program Development in C: Solutions 41
A palindrome is a number o r a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers are palindromes: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether or not it is a palindrome. [ Hint : Use the division and r emainder operators to separate the number into its individual digits.]
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
42
Structured Program Development in C: Solutions
Enter a five-digit number: 18181 18181 is a palindrome
Chapter 3
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Chapter 3
Enter a binary number ( 5 digits maximum ): 10111 The decimal equivalent of 10111 is 23
Structured Program Development in C: Solutions 43
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
44
15 16
Structured Program Development in C: Solutions
} /* end main */
Chapter 3
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.