7.4 Code Practice Question 2
Question:
Erin 1000.
AP CS
6 months, 3 weeks agone
'7.iv Lesson Do (projectstem): what is output if the user is enters 2? Question 2 For Questions 2-four consider he followwime po def tryit(al Ibl IS lnb retumm Ja Ib #Master n intkinputkentler ans eMviekm B impress Kana) UHHHDHHa What is output if thie Ueerenters 20'
Video Answer:
Related Question
'4.7 Code Practice: Question 1 Instructions Write a for) loop to print the numbers from xx to xxx,inclusive (this means it should include both the 20and thirty). The output should all be written out on the same line: Expected Output 20 21 22 23 24 25 26 27 28 29 xxx'
Discussion
Y'all must exist signed in to discuss.
where tin fifty discover the answer
Video Transcript
Howdy students, nosotros need to write a for loop in order to print the numbers from 20 to 30. 20 to 30 must be enough. Print the expected output. The numbers 20 and 30 should be present. Allow's talk nearly something basic, like what is the importance off? No. I remember I take a startup company and I take different windows, then on a detail day I want to keep my company off, and then I need to tell all my windows For my company. What happens if I start sending individual males? I have to send each and everyone. I will write a code that will send 10,000 windows in a straight and it volition reduce my work. The importance of loop is that it reduces my tedious job. If I talk almost what is basically lou loop is nada but information technology can execute a block of good multiple times or nosotros can say a number of times, we will exist moving with it. Correct at present, the question. We demand to know nigh the four loops. The for loop is a control flow statement. What will it do? Information technology will execute a number of blocks, multiple number of times or we can say repetitive or in particular technical definition, if nosotros talk about for follow, it is a control menstruation statement for specifying iteration or we can say reputation which allows quote to exist executed repeatedly. The main function is what we have covered. We need to know the syntax for the for loop at present that we take it. The commencement thing we demand to do is write the code, and then nosotros have the status, and so nosotros tin can either concur or disagree. There are many statements according to the concerns after the brackets. This is the basic lawmaking for this loop. Let'southward start working on the question of writing a follow upwards to the number set of numbers. We will be using the c programming language to date. In this C programming language, the first thing we write is hash include, followed by brackets and STD io dot h. We are using into maine now as we need to print the follow and we need to initialize a variable that volition be used in the whole plan. To start with xx because nosotros need to keep 20 so we will write equal to 20. We need this xxx inclusive. Nosotros can either become with less than 30 or less than 31 and it will requite us the same consequence. We need to increment information technology from 20 to 21 so it will be I with the increment. The printed statement will exist written by usa. The expected output take a chance space between two numbers is what you volition be writing about. 3 D is the space betwixt two numbers. We will complete the inverted blackout afterward that. We volition write 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 888-353-1299 We volition either close the brackets or retire zero in the finish. The output volition be 20 21 22 23 24 25 26 27 28 29 and the last number will exist 30. We tin can conspicuously meet that we take included twenty and 30. This was the main betoken of view. We will walk the same program in the same place and see if it gives usa the aforementioned output or not. Let'due south have a look and move on. Let's write the plan. This was a specific program and now we will execute it and we will encounter the result and we volition get the same result. Changing the condition that the heart is less than 30 what we become will bear witness you. This portion has been changed from I less than equal. Less than 31. It has been changed to I less than 30. Let'southward execute and look for something. Nosotros become the same dessert when we change the status. I hope yous take understood the concept of using this for loop and have a great twenty-four hour period.
7.4 Code Practice Question 2,
Source: https://www.numerade.com/ask/question/74-lesson-practice-projectstem-what-is-output-if-the-user-is-enters-2-question-2-for-questions-2-4-consider-he-followwime-po-def-tryital-ibl-is-lnb-retumm-ja-ib-main-n-intkinputkentler-ans-e-99942/
Posted by: kirkseystionve.blogspot.com
0 Response to "7.4 Code Practice Question 2"
Post a Comment