0% found this document useful (0 votes)
205 views

Flowchart

This document contains 6 programs with the following summaries: 1. This program calculates the sum of the digits in a number. 2. This program calculates the sum of squares from 1 to 51. 3. This program calculates the average of even and odd numbers inputted up to 100, and prints the results.

Uploaded by

Joanna Quinto
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
205 views

Flowchart

This document contains 6 programs with the following summaries: 1. This program calculates the sum of the digits in a number. 2. This program calculates the sum of squares from 1 to 51. 3. This program calculates the average of even and odd numbers inputted up to 100, and prints the results.

Uploaded by

Joanna Quinto
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

#3 Start

Read N

Sum=0

Yes Sum=N/10,000+((N%10,000)/1,000)+(((N%10,000)%1,000)/100)+((((N%10,000)%1,000)%100)/10)+(((((N
N/10,000≥ %10,000)%1,000)%100)%10)
1? End Print Sum
No
Yes
Sum= N/1000+((N%1000)100)+(((N%1000)%100)/10)+(((N%1000)%100)%10)
N/1,000≥1 Print Sum
?
No
0≥1 Yes
Sum=N/100 + ((N%100)10) + ((N%100) Print Sum
N/100≥1? %10)

0≥1 No

Yes
N/10≥1? N/10+ (N%10) Print Sum

0≥1
No
End

#5 Start

C=0 SUM=0

C=C+1

SUM= SUM+(C^2)

No
C=51?

0≥1 Yes

Print Sum

By: Cortez, Nina Colleen J. 2ChE-A


End
#6 Start

EvenSum=0 OddSum=0 EvenCtr=0

OddCtr=0 EvenAve=0 OddAve=0 C=0

Read N

EvenCtr=EvenCtr+1

Yes
EvenSum=EvenSum+N No
N C=100
%2=0? C+1 1?
No No Yes
0≥1
OddCtr=OddCtr+1 0≥1

OddSum=OddSum+N No
C=100
C+1 1?
Yes EvenAve=EvenSum/EvenCtr
0≥1
OddAve=OddSum/OddCtr

EvenAve=EvenSum/EvenCtr

OddAve=OddSum/OddCtr

Print EvenAve
By: Cortez, Nina Colleen J. 2ChE-A
Print OddAve

Print EvenAve Print EvenSum

Print OddAve Print OddSum

Print EvenSum

Print OddSum

End

End

You might also like