Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!yale!cmcl2!lanl!lambda!ttw From: ttw@lambda.UUCP (Tony Warnock) Newsgroups: comp.lang.misc Subject: Re: Lessons from Algol (Was: JLG's flogging of horses) Summary: Re Fortran and C I/O Message-ID: <14357@lambda.UUCP> Date: 3 May 90 19:59:04 GMT References: <1990Apr19.180903.27750@maths.nott.ac.uk> <4277@tukki.jyu.fi> Lines: 18 With respect to the C statement: printf("The answer is %d, not %d\n", ans, resp) one can use the following Fortran statement write(*,*)' The answer is',ans,' not',resp which seems as simple as the C version. The suggested WRITE (BUFFER,100) PRINTLENGTH(ANS),PRINTLENGTH(RESP) 100 FORMAT('(;;The answer is '',',I1,','',not '',',I1,;I;;)') WRITE(5,BUFFER)ANS,RESP seems to be somewhat verbose. ( Of couse my suggestion could be in upper case if desired. )