Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem in fortran program

  1. Apr 24, 2006 #1
    hello everyone!
    I was do programming in fortran and i wanted to print my answer in the format below. I was not able to do it. I have written a part of my program also.
    greeting = 'Good Morning!'
    do 110 I = 1, 12
    write (*,115) (greeting)
    115 format (A<I>)
    110 continue
    here i want to use a variable 'I' in the format statement i tried it doing but i failed. so plz if anyone knows to use a variable in format statement tell me.
    I use gcc-3.4.6 compiler.

    output of the program
    Good M
    Good Mo
    Good Mor
    Good Morn
    Good Morni
    Good Mornin
    Good Morning

    Plz mail to me at ajeet3047@gmail.com
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted

Similar Discussions: Problem in fortran program
  1. Programming in fortran (Replies: 5)