You are given a string which you have to write in a ZIGZAG fashion in n number of rows and then read it again row by row and store it in a string. For example, "ZOPSMARTHIRING" and number of rows = 3 Z H M OSATI PR R N I G Output => "ZMHN" + "OSATIIG" + "PRR" = "ZMHNOSATIIGPRR"

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question
You are given a string which you have to
write in a ZIGZAG fashion in n number of
rows and then read it again row by row and
store it in a string.
For example, "ZOPSMARTHIRING" and
number of rows = 3
Z
H
M
OSATI
PR R
N
IG
Output => "ZMHN" + "OSATIIG" + "PRR" =
"ZMHNOSATIIGPRR"
Transcribed Image Text:You are given a string which you have to write in a ZIGZAG fashion in n number of rows and then read it again row by row and store it in a string. For example, "ZOPSMARTHIRING" and number of rows = 3 Z H M OSATI PR R N IG Output => "ZMHN" + "OSATIIG" + "PRR" = "ZMHNOSATIIGPRR"
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Methods of StringBuilder class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT