Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

integer

program collatz
implicit none
integer :: numero 27, resultado, par 
   print *, 'dame numero entero'
   read *, numero 27
   print *, 'vamos a ver si es maravilloso el numero', numero 27
   resultado=numero 27 
   do
   par= mod(resultado, 2)
   if (par==0) resultado=resultado/2
   if (par>0) resultado=3 *resultado +1 
   print *, 'resultado'
   if(resultado==1)then
   print *, 'el numero es maravilloso'
   exit
   end if
   end do
   end program collatz

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.