You can try this. Notice that if you enter a number n > 9, it will not work (and for n > 5, it's not that pretty).
program pascal
implicit none
integer :: i, j, n, c
read(*, *) n
do i = 0, n - 1
c = 1
do j = 0, n - i
write(*, "(' ')", advance="no")
end do
do j = 0, i
write(*, "(I2)", advance="no") c
c = (c * (i - j)) / (j + 1)
end do
write(*, *)
end do
end program
In your program, almost everything is right, except when you print : Fortran add always a new line if you don't add the optional advance="no"
.
Regarding style, it's not very useful here to put formats in a separate line, and .lt.
can be replaced by <
in Fortran 90. Also, your indentation is not correct in the inner loops.