0
program loops

implicit none

integer x
integer::y

do x=1,10
  y=3*x
  print*,"3 times ",x,"=",y
end do

end

I want to create a multiplication table for 3. The program can be compiled and runs, but the formatting or the display does not look good as there is lot of spaces. How can I improve or do formatting to make the display look good?

Roshan Shrestha
  • 178
  • 2
  • 10
  • 1
    Use your favourite references to learn about the `write` statement and about `edit descriptors` and about `format`ing in general. Even a browse around here on SO will lead you in some useful directions. – High Performance Mark Feb 16 '16 at 17:00
  • 1
    `write(*,'(I3," times 3 = ",I5)') x,y ` may help you – Abolfazl Feb 16 '16 at 19:48

0 Answers0