i need to get 3 numbers from the user and the program will calculate the average of the numbers
Your topic was Moved to it's current location / section as it is more suitable.
Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Is this an Arduino project?
How to make an average calculator
Sum and divide. ![]()
i need to get 3 numbers from the user
How? With a keypad? From a computer?
What do you need help with?
How are you going to display the results? LCD or LED display? On a computer?
If you are using a computer, how do you wish to connect? And, if you're using a computer, why use an Arduino? ...Maybe a homework assignment?
You can piece this together from Arduino example sketches. For example, here is one that reads numbers (just ignore the LED code):
Look at the "smoothing" example In your Arduino IDE
File > Examples > Analog > Smoothing
int num1 = 1;
int num2 = 2;
int num3 = 3;
int average;
void setup() {
Serial.begin(115200);
average = (num1 + num2 + num3) / 3;
Serial.print(average);
}
void loop() {
}
Uncompiled, try this though, see if it makes sense.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.