Trabajos
Escribir "Dime un numero";
Leer x;
Si x > 0 Entonces
Escribir "Es positivo";
Sino
Si x < 0 EntoncesEscribir "Es negativo";
FinSi
FinSi
Fin
ESCRIBIR "Introduce un n£mero: "
LEER num
SI num = int( num / 2 ) * 2 ENTONCES
ESCRIBIR "es par"
SINO
ESCRIBIR "es impar"
FINSI FINPROGRAMA
2. RECONOCER SI UN NÚMERO ES PRIMO O NO.
Inicio
escribe "Introduce numero:"
lee n
cont = 0
para i = 1 hasta n hacer
si nmod i = 0
cont =cont + 1
fin_si
fin_para
si cont = 2 hacer
escribe "El numero es primo"
si_no
escribe "El numero noes primo"
fin_si
Fin
3. OBTENER EL FACTORIAL DE UN NÚMERO
inicio
factorial = 1
si numero >= 1 entonces
haga desde i=1 hasta numerofactorial = factorial*i
fin_desde
sino
si numero = 0
factorial = 1
sino
imprimir("No se puede calcularfactorial; número negativo")
fin_si
fin_si
fin
4. PASAR UN NÚMERO DE DECIMAL A BINARIO Y DE BINARIO A DECIMAL.
INICIO
Solicitar al usuario numeroDecimal.
SI el numero es 0 ó 1 ENTONCES.
IMPRIMIR el numero Binario es igual el numero decimal.
SI NO es 0 ó 1 ENTONCES.
MIENTRAS cociente sea MAYOR a 1.
DIVIDIR elnumero decimal entre 2.
IMPRIMIR residuo.
Terminar MIENTRAS.
SI el cociente es igual a 1.
Imprimir 1.
Terminar SI
FIN
5. A PARTIR DE UN NUMERO ENTERO NMAYOR QUE CERO OBTENER N CANTIDAD DE
LOS TÉRMINOS DE FIBONACCI
6. OBTENER EL PROMEDIO DE N NÚMEROS MEDIANTE UN CICLO
Empieza
escribe "Cuantos numeros...
Regístrate para leer el documento completo.