lab5 Flashcards Preview

NWP2 lab > lab5 > Flashcards

Flashcards in lab5 Deck (9)
Loading flashcards...
1
Q

The length of the string can be specified by

A

len specifier

2
Q

Character constants are given between

A

a pair of double or single quotes

3
Q

Concatenation

A

joins different strings in one (//)

4
Q

write a program that joins the words

I, love, apples

A

character(len=13)::a,b,c

a=’i’

b=’love’

c=’apples’

print*,a//b//c

5
Q

print the word apples in the following (i love apples)

A

character(len=40)::a

a=’i love apples’

print*,a(8:13)

6
Q

how to find a word in fortran

A

cword=’test’

n=index(cword,ch)

print*,n

7
Q

adjust the text to the right

A

adjustr

8
Q

adjust to the left

A

adjustl(a)

9
Q

adjust to the center

A

adjustc(a)