1 / 16

Flowchart Tutorial

Flowchart Tutorial . Example 1:. Draw a flowchart to find the sum of first 50 natural numbers. . start. SUM=0. N=0. N=N+1. SUM=SUM+N. no. IS N==50? . yes. Print SUM. END. Example 2. Draw a flowchart to find the largest of three numbers A, B, and C. . START. READ A,B,C. yes.

anika
Télécharger la présentation

Flowchart Tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flowchart Tutorial

  2. Example 1: Draw a flowchart to find the sum of first 50 natural numbers.

  3. start SUM=0 N=0 N=N+1 SUM=SUM+N no IS N==50? yes Print SUM END

  4. Example 2 Draw a flowchart to find the largest of three numbers A, B, and C.

  5. START READ A,B,C yes IS B >C ? no IS A>B ? yes IS A>C ? yes no no PRINT C PRINT A PRINT B END

  6. Example 3 Draw a flowchart for program Find the difference and the division of two numbers and display the result.

  7. START READ N1 , N2 D=N1-N2 V=N1/N2 PRINT D , V STOP

  8. Example 4 Draw a flowchart for program Print the first 10 natural number

  9. start N=1 Print N N=N+1 yes while N <= 10 no END

  10. Example 6 Draw a flowchart for program Calculate the student grade ( A,B,C,D,F)

  11. start Read Grade Grade >=90 Print A yes no Grade >=80 Print B yes no Grade >=70 yes Print C no Grade >=60 yes Print D no Print F END

  12. Example 7 Draw a flowchart for program read temperature , If temp > 0 print above freezing else below freezing

  13. start Read Temp Temp >0 yes Print“above freezing” no Print“below freezing” End

  14. Example 8 Draw a flowchart for program read (10) marks for (20) students, then print the average for each student.

  15. START studentCount=0 markCount=0 sUM=0 , avg=0 While studentCount <20 no yes STOP While markCount<10 no avg=sUM/10 yes PRINT avg READ x Increment studentCount sUM=sUM+x Increment markCount avg=0 , sUM=0 markCount=0

More Related