Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
divisibility rule
!gfortran, gcc version 7.4.0 program hello implicit none real::n=50.0 integer::i,ca=0,cb=0,cc=0,cd=0,fl integer,dimension(50)::a,b,c,d do i=1,50 if(mod(i,2)==0)then ca=ca+1; a(ca)=i; end if end do write(*,*)'Divisible by 2 :',(a(i),i=1,ca) do i=1,50 if(mod(i,3)==0)then cb=cb+1; b(cb)=i; end if end do write(*,*)'Divisible by 3 :',(b(i),i=1,cb) do i=1,50 if(mod(i,5)==0)then cc=cc+1; c(cc)=i; end if end do write(*,*)'Divisible by 5 :',(c(i),i=1,cc) do i=1,50 if(mod(i,7)==0)then cd=cd+1; d(cd)=i; end if end do write(*,*)'Divisible by 7 :',(d(i),i=1,cd) print*,'Divisible by 2,3,5 and 7 are :' fl=floor(n/210); print*,fl end program hello
run
|
edit
|
history
|
help
0
A_01 FIXED_POINT_IM(I)
A_002 THE GUASS SEIDEL
A_04 SIMPSON'S ONE THIRD(3(I))
Sum 1 to 99 divided by 12 to 100
Practice
y
We subroutine
LU gauss
Fortran!
fucugigugug