💻 Hacer un programa que muestre 10 números aleatorios generados automaticamente dentro del rango de 10 al 99.
Algoritmo programacion_work
//Crea 10 números al azar
Definir N como Entero;
Para N <- 1 Hasta 10 Con Paso 1 Hacer
Escribir ALEATORIO(10,99);
FinPara
FinAlgoritmo
print("MUESTRA 10 NÚMEROS ALEATORIOS")
import random
for N in range(10):
print(random.randint(10,99))
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main() {
srand(time(NULL));
for(int N=1; N<=10; N++){
printf("%d\n",10+rand()%(100-10));
}
return 0;
}
#include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
int main() {
srand(time(NULL));
for(int N=1; N<=10; N++){
cout << ( 10+rand()%(100-10) ) << endl;
}
return 0;
}
package programacion_work;
import java.util.Scanner;
public class 10numeros_random {
public static void main(String[] args) {
for(int N=1; N<=10; N++){
System.out.println( (int)(Math.random()*(99-10+1)+10) );
}
}
}