Ejemplo Estructura While Simula Teclado
-
Upload
alejandra-estrella-navarrete -
Category
Documents
-
view
221 -
download
0
Transcript of Ejemplo Estructura While Simula Teclado
-
7/25/2019 Ejemplo Estructura While Simula Teclado
1/3
Ingresar una cantidad de numerous y luego sumar esa cantidad de nmeros.La
cantidad puede ser inicialmente cero, con lo cual puede no tener que procesar
nada.
set serveroutput on;
declare
valor number := 0;
FU!"I# $I%UL&'"(!L&)# return number is
type vector is varray*+ o- number;
mivector vector := vector*/, , 10,0;
indice pls'integer ;
indiceatural natural ;
result number ;
semilla number;
2(3I
semilla := dbms'random.random;
indice := semilla mod + ; indice := indice 4 ;
!&$(
56( indice 7 0 "6( indiceatural:= indice 8 *9;
56( indice 0 "6( indiceatural:= indice ;
(L$(
indiceatural:= ;
() !&$(;
dbms'output.put'line*el indice es
-
7/25/2019 Ejemplo Estructura While Simula Teclado
2/3
();
v'cantidad number:=0;
i number:=0;
v'sum number:= 0;
2egin
>'cantidad:= ?cantidad;
5ile i7 v'cantidad loop
i:= i4;
valor:= $I%UL&'"(!L&)#;
v'sum:= v'sum 4 valor;
dbms'output.put'line*valor
-
7/25/2019 Ejemplo Estructura While Simula Teclado
3/3
1
10 +0 B
/ C/