-
Notifications
You must be signed in to change notification settings - Fork 0
/
ejercicio8Guia3.psc
22 lines (18 loc) · 967 Bytes
/
ejercicio8Guia3.psc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//Realizar un procedimiento que permita realizar la división entre dos números y muestre el
//cociente y el resto utilizando el método de restas sucesivas.
//El método de división por restas sucesivas consiste en restar el dividendo con el divisor hasta
//obtener un resultado menor que el divisor, este resultado es el residuo, y el número de restas
//realizadas es el cociente. Por ejemplo: 50 / 13:
// 50 ? 13 = 37 una resta realizada
// 37 ? 13 = 24 dos restas realizadas
// 24 ? 13 = 11 tres restas realizadas
// dado que 11 es menor que 13, entonces: el residuo es 11 y el cociente es 3.
Algoritmo ejercicio8Guia3
Definir dividendo, divisor, residuo, diferencia, num Como Real
Escribir "Por favor Ingrese el dividendo"; leer dividendo
Escribir " Por favor Ingrese el divisor"; leer divisor
FinAlgoritmo
SubProceso residuo <- divisionpepe1 ( dividendo por referencia, devisiro por Referencia)
si residuo > divisor Entonces
FinSi
FinSubProceso