This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: C = Len_Trim(String) !Create a variable to be used later on to output the ASCII values for the entered characters E = (C/4) + 1 !Create a shape array to be used in the reshape command Shape = (/ 6 , 4 /) !Create a pad array to be used in the reshape command Pad = (/ 0 , 0 /) !Convert the string into a one dimensional array do A = 1, C Array1(A) = String(A:A) end do !Reshape the created array into the correct shape of four columns Array = reshape(Array1, Shape,Pad, (/2,1/)) !Use a do loop to calculate the ASCII value for each input character of the array do I = 1,6 do J = 1,4 ASCII(I,J) = ichar(Array(I,J)) end do end do !Use another do loop to output the corresponding ASCII value for !the input character and leave out the blank values. do B = 1,4 do D = 1, E Write(*,*)ASCII(D,B) end do end do stop end...
View Full Document
This note was uploaded on 10/05/2009 for the course ENGR 117 taught by Professor Staff during the Spring '08 term at Purdue University-West Lafayette.
- Spring '08
- Computer Programming