Arduino generate only one random number

I have a task where I need to display random number for arduino and need it to display on LCD but after several coding , my LCD keep on and continuously display different number one after another , I only need it to display only one random number and it will not change .

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
long randomnumber;

void setup() {
// put your setup code here, to run once:

lcd.begin(16, 2);
randomSeed(10);
}
void loop() {
randomnumber = random(10);
lcd.setCursor(0, 0);
lcd.print(randomnumber);
}

Would somebody show me how?

Take all the code in loop and move it to the end of setup.

Thank you

  randomSeed(10);

This guarantees the same random number on each run (after the change), do you really want that?

Whandall:

  randomSeed(10);

This guarantees the same random number on each run (after the change), do you really want that?

One could always use randomSeed(analogRead(A0)); //change to an unused analog pin
The floating pin returns a "noise" value that seems quite random. Works for the sketch I use it in.

DangerToMyself:
One could always use...

...something proven to be no better than...

randomSeed(10);

A better choice...
The reliable but not very sexy way to seed random.

That thread also includes a solid argument against using analogRead for entropy.

Random enough for my purposes. Maybe not for someone else's. Only they can make that determination.

But I'll keep that link in mind if I ever find a need for it. Thanks.

If there is user interaction, a seed can be derived from micros of first interaction.

That alone does not work particularly well for the Park-Miller generator and the way it is typically used in the Arduion world. Relatively low seed values result in a short string of distinctly non-random values. Shifting / rotating the micros value should help. (Or using Park-Miller the way it was intended to be used.)

DangerToMyself:
Random enough for my purposes.

Your purposes are currently irrelevant. We're here to help @Sammakini.

[quote author=Coding Badly link=msg=4313562 date=1569116211]
Your purposes are currently irrelevant. We're here to help @Sammakini.
[/quote]Obviously. But having options doesn't hurt Sammakini either. That said, if you feel my reply above does more harm than good, feel free to delete it.