|
!....Pues en este articulo les comparto mis practicas de Power Builder 11.0 ...!
OPERACIONES NUMERICAS

Codigo Fuente:.....
integer inicial, final,factorial,r
integer resi,a,conta,primo,bucle,cad,suma,suma1
lb_1.reset()
inicial=integer(sle_numero1.text)
final=integer(sle_numero2.text)
if rb_pares.checked=true then
for inicial=2 to final step 2
lb_1.additem(string(inicial))
next
end if
st_total.text=string(lb_1.totalitems())
//________________________________--
if rb_impares.checked=true then
for inicial=1 to final step 2
lb_1.additem(string(inicial))
st_total.text=string(lb_1.totalitems())
next
end if
//___________________________________
factorial=1
for r=integer(st_total.text) to 1 step -1
factorial= factorial* r
next
st_factorial.text=string(factorial)
//_______________________________
if rb_primos.checked=true then
for inicial=inicial to final
conta=0
primo=inicial
for bucle=1 to primo
resi=mod(primo,bucle)
if resi =0 then
conta=conta+1
end if
next
if conta<=2 then
cad=integer(primo)
suma=suma+primo
st_suma.text=string(suma)
lb_1.additem(string(cad))
end if
next
st_factorial.text=string(factorial)
st_total.text=string(lb_1.totalitems())
end if
--------------------------------------------------------------
|