CHARACTER2
!Program name:CHARACTER2
Implicit none
character (80) :: text
character (len=6) :: title
character (len=15) :: surname,
firstname
character (len=60) :: name,
name2
integer :: i
Write (*,*) 'Give your title,
first name and surname: '
Read *, title, firstname,
surname
name=
trim(title)//trim(firstname)//trim(surname)
name2 =
title//firstname//surname
Print *, 'Hello,', name
Print *, 'Hello,', name2
Text='Do you believe in the
power of love?'
i=index(text,'love')
If (i /= 0) then
print *, 'The word LOVE is at
position: ', i
print *, 'in the text: ', text
end
if
stop
Comentários
Postar um comentário