Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8739311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:54:43+00:00 2026-06-13T10:54:43+00:00

Write pseudocode of algorithm reading sequence of numbers diffrent than zero which counts sum

  • 0

Write pseudocode of algorithm reading sequence of numbers diffrent than zero which counts sum of even and odd numbers. (we don’t know how many numbers we have to read)<– this part is problematic for me.
I assumed A is array.

ALGOR(A)
even <-- 0
odd <--- 0
for i <-- 1 to **???**
    n = A[i]
while n > 0
        do n <-- n - 2
if n = 0
    then even <-- even + n
else 
    do odd <-- odd + n
write(Odd's sum: ), write(odd), write(\n), write(Even's sum: ), write(even)

Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:54:44+00:00Added an answer on June 13, 2026 at 10:54 am

    use a while construct to collect your input – not a for. Break the loop when you get something that isn’t a number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Write a NASM macro: divide, which has 2 arguments, which specify unsigned integers in
Write a NASM macro: divide, which has 2 arguments, which specify unsigned integers in
I write app for Android which will be communicate with HTTP server. I need
I'm trying to write a merge sorting algorithm in Perl and I've attempted to
This may be subjective, I don't know: I have this problem, which I'm kind
I am attempting to write a Genetic Algorithm based on techniques I had picked
Hi! I'm trying to write a negamax search algorithm for my chess engine, but
This question is for a program I am trying to write which involves connecting
I have some difficulties in converting a pseudocode into a MatLab algorithm. Specifically, there
The question: Write an algorithm that given an array A and an integer value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.