loops

User Generated

NT85

Computer Science

Description

Hey how are you my friend , here is new assinment for you, Download the word document, and answer each question.

Unformatted Attachment Preview

CSCI 180 Lab 8 Objectives: 1. To learn how loop statements work 2. To learn how to write a repetition statement 3. To learn how a repetition statement flows Laboratory Assignment: (2pts each) 1. , ___ , ______ loops execute a set of statements once for each value in a specified range and they are implemented in C by a statement. 2. What are the four components of a counting for loop? 3. The terminating statement in a forever loop is usually a(n) combination statement. 4. a) A while loop is a b) A do loop is a 5. The body of a or or or loop. loop. loop is always executed at least once. 6. Estimate how many times each loop will perform. Write a trace table for the following code. a) for ( i = 3; i < = 7; i++) printf(“2 * %d = %d\n”, i, 2*i); Estimate: b) k = 5; i = -2; while ( i = 0); d) i = 0; j = 0; for ( ; ; ) { k = 2 * i * j; if ( k > 10) break; printf( “%5d %5d %5d\n”, i, j, k ); } Estimate: (5pts each) 7. Write C loop to display the square roots of the real numbers: 1.0, 1.25, 1.5, 1.75, 2.0, … , 5.0. 8. Write C loop to display one character ‘*’ to build a Christmas tree figure as shown below. * ** *** **** ***** ****** ** ** 9. Write C loop to stop reading and displaying an input of a character when the letter Y is selected. It must be able to stop for both cases! 10. Write C loop to display the multiplication table as shown below. 1 2 3 4 5 6 7 8 1 1 2 2 4 3 3 6 9 4 4 8 12 16 5 5 10 15 20 25 6 6 12 18 24 30 36 7 7 14 21 28 35 42 49 8 8 16 24 32 40 48 56 64 9 9 18 27 36 45 54 63 72 9 81
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello, nice to meet you! :) I attached the answers of the assignment.

CSCI 180 Lab 8
Objectives:
1. To learn how loop statements work
2. To learn how to write a repetition statement
3. To learn how a repetition statement flows

Laboratory Assignment:
(2pts each)
1. Counting loops or counter-control...


Anonymous
Awesome! Perfect study aid.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags