15.1k views
1 vote
Fine the sum of odd number from 1 to 100 using psudecode​

User Tomjn
by
7.6k points

1 Answer

1 vote

Answer:

Here's the pseudocode to find the sum of odd numbers from 1 to 100:

Set sum = 0

For i = 1 to 100

If i is odd

Add i to sum

End if

End for

Display sum

In this pseudocode, we initialize the sum variable to 0, then use a for loop to iterate through the numbers 1 to 100. For each number, we check if it is odd by using the "is odd" condition. If the number is odd, we add it to the sum. After the loop is finished, we display the sum of all the odd numbers from 1 to 100.

User Bautista
by
7.6k points

No related questions found