Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Pascal adding inputs


  • Please log in to reply

#1
SOORENA

SOORENA

    Member

  • Member
  • PipPipPip
  • 974 posts
I was wondering how you can add inputs that the user enters. Oh and the user is inputing as much as they want. The inputs are numbers. The user is supposed to enter a few numbers and my program is supposed to add them and then get the average.

Edited by SOORENA, 21 February 2006 - 09:12 PM.

  • 0

Advertisements


#2
Hai Mac

Hai Mac

    Member

  • Member
  • PipPipPip
  • 260 posts
Hello SOORENA,
I would define a large integer array (or float). Then use readln() or read() procedure to get the user input and store it in the array. Loop the input until the user enters, let's say, zero. Then exit the loop and add up the numbers, divide them by the number of inputs and voila, you have an average.

:tazz:
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP