12Character Manipulations

# 12Character Manipulations - CHARACTER MANIPULATION 2...

This preview shows pages 1–16. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CHARACTER MANIPULATION 2 DECLARATIONS AND EXPRESSIONS CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) Where // is a concatenation operator, that combines two character values. B C A 4 3 2 1 3 DECLARATIONS AND EXPRESSIONS CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) B C 4 3 2 1 A 2 1 4 DECLARATIONS AND EXPRESSIONS CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) B C 4 3 2 1 A 2 1 5 DECLARATIONS AND EXPRESSIONS CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) B 4 3 2 1 C 4 3 2 1 A 2 1 6 DECLARATIONS AND EXPRESSIONS B 4 3 2 1 C 4 3 2 1 A 2 1 CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) 7 DECLARATIONS AND EXPRESSIONS B 4 3 2 1 C 4 3 2 1 A 2 1 CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) 8 DECLARATIONS AND EXPRESSIONS B 4 3 2 1 C 4 3 2 1 A 2 1 CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) 9 DECLARATIONS AND EXPRESSIONS B 4 3 2 1 C 4 3 2 1 A 2 1 CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) 10 DECLARATIONS AND EXPRESSIONS B 4 3 2 1 C 4 3 2 1 A 2 1 CHARACTER(len =4) :: A, B, C A ='1234' B = '12' WRITE(*,*) B C = '123456' WRITE(*,*) C WRITE(*,*) A // B WRITE(*,*) B // A B = B // A WRITE(*,*) A(2:2)//B(1:2) 11 DECLARATIONS AND EXPRESSIONS CHARACTER :: D*8, E(5)*4 D = 'ABCDEFGH' WRITE(*,*) D(2:4) WRITE(*,*) D(2:) WRITE(*,*) D(:4) E(1) = 'WXYZ' WRITE(*,*) E(1)(2:2) D E(1) E(2) E(3) E(4) E(5) 12 DECLARATIONS AND EXPRESSIONS ‘H’ ‘G’ ‘F’ ‘E’ ‘D’ ‘C’ ‘B’ ‘A’ D E(1) E(1) E(2) E(3) E(4) E(5) CHARACTER :: D*8, E(5)*4 D = 'ABCDEFGH' WRITE(*,*) D(2:4) WRITE(*,*) D(2:) WRITE(*,*) D(:4) E(1) = 'WXYZ' WRITE(*,*) E(1)(2:2) 13 DECLARATIONS AND EXPRESSIONS ‘H’ ‘G’ ‘F’ ‘E’ ‘D’ ‘C’ ‘B’ ‘A’ D E(1) E(1) E(2) E(3) E(4) E(5) CHARACTER :: D*8, E(5)*4 D = 'ABCDEFGH' WRITE(*,*) D(2:4) WRITE(*,*) D(2:) WRITE(*,*) D(:4) E(1) = 'WXYZ' WRITE(*,*) E(1)(2:2) 14 DECLARATIONS AND EXPRESSIONS ‘H’ ‘G’ ‘F’ ‘E’ ‘D’ ‘C’ ‘B’ ‘A’ D E(1) E(1) E(2) E(3) E(4) E(5) CHARACTER :: D*8, E(5)*4 D = 'ABCDEFGH' WRITE(*,*) D(2:4) WRITE(*,*) D(2:) WRITE(*,*) D(:4) E(1) = 'WXYZ' WRITE(*,*) E(1)(2:2) 15 DECLARATIONS AND EXPRESSIONS...
View Full Document

{[ snackBarMessage ]}

### Page1 / 148

12Character Manipulations - CHARACTER MANIPULATION 2...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online