Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a program recives from user sentence (by cin.getline(sentence,N) (const int N=1000) after this ask from user to enter random number the program should devide

write a program recives from user sentence (by cin.getline(sentence,N) (const int N=1000) after this ask from user to enter random number

the program should devide the sentence for parts by the random number mean

if the random number was 3 every three letters make an word and after this reverse each word

for example :

enter an sentence: hi, my name is

enter an number: 4

output:

,ih n ym ema is

(he take first (hi, ))with the space and change every letter in it mean the last put it in the first and first in last and the second in third and third in second

after this take (my n)and change it etc.....

in the last if we still have letters that is not four mean

this sentence contains 14 index and the number is 4 mean we have two index in the last we dob't change them

c++ program

we don't use string just char and array of char

using strcpy, cin.puback(),strlen ,strcmp, cin.peek(),(we can jsut use these thing not string )

#include #include #include #include #include

using std::cin; using std::cout; using std::endl;

image text in transcribed

Hi, my name Number=3 Hi, my namae ,hiym an eam

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

=+ How can this information be obtained from them?

Answered: 1 week ago