Computers and Technology

Translate the following pseudocode for randomly permuting the characters in a string into a C program. Read a word.
Repeat word. length() times
Pick a random position i in the word.
Pick a random position j > i in the word.
Swap the letters at positions j and i.
Print the word.
To swap the letters, construct substrings as follows:
first i middle j last
Then replace the string with
first + word. substr(j,1) + middle+ word. substr(i,1) + last
Please make copy paste available
Please write in C++

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 01:30, tanya44737
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, juuuuuu42
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
image
Computers and Technology, 24.06.2019 15:30, livagrace
Emma is using an artificial intelligence system, which contains information on botany, to identify a type of plant from an image. what type of ai is emma using?
Answers: 1
image
Computers and Technology, 25.06.2019 05:00, natewestly6464
The ratio of men to women in a certain factory is 3 to 4 .there are 210 men. how many workers are there?
Answers: 2
Do you know the correct answer?
Translate the following pseudocode for randomly permuting the characters in a string into a C progra...

Questions in other subjects:

Konu
Mathematics, 13.08.2020 09:01
Konu
History, 13.08.2020 09:01
Konu
Geography, 13.08.2020 09:01
Konu
Health, 13.08.2020 09:01