1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nikklg [1K]
3 years ago
9

g given the signature of a function void ascendingwords(char sentence[], int size), where sentence is an array of characters(i.e

. a null terminated string) and size is the amount of memory allocated for the buffer sentence. Complete the function to print the words in the sentence in an ascending order. the user needs to provide the input. for example if the sentence is Programming is Fun. then the function should print the output Fun is Programming
Computers and Technology
1 answer:
BlackZzzverrR [31]3 years ago
6 0

Answer:

// This program is written in C++ programming language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

using namespace std;

// Function starts here

string ascendingwords(string sentence)

{

// Calculate length of input text

int len = sentence.length() - 1;

// Create a begin and end variable

int begin, end = len + 1;

// Declare and initialize an output string

string output = "";

// Perform iteration while there's still some text in the input string

while(len >= 0)

{

if(sentence[len] == ' ')

{

begin = len + 1;

while(begin != end)

output += sentence[start++];

output += ' ';

end = len;

}

len--;

}

begin = 0;

while(begin != end)

output += sentence[begin++];

return output;

}

// Main method starts here

int main()

{

// Declare string

string sentence;

// Prompt user for input

cout<<"Enter a string: ";

cin>>sentence;

cout <<ascendingwords(sentence);

return 0;

}

You might be interested in
Current versions of windows support file names up to ________ characters long
Verizon [17]
Newer, or current versions of Windows from XP to 10 use the NTFS file system. The file system supports up to 255 characters in a file name. The total path length supports up to 30,000 characters.
3 0
3 years ago
What class of attacks use innovative attack tools and once a system is infected it silently extracts data over an extended perio
KatRina [158]

Answer:

Advanced persistent threat.

Explanation:

Advanced persistent threat is a threat actor implemented by either a government supported or private group to intrude a network or system and stays undetected, collecting information over a period of time.

It is used by cyber terrorist group to facilitate massive attacks based on the information retrieved. National or government group use the concept to promote national security.

7 0
3 years ago
When you print ____, the presentation is printed with one or more slides on each piece of paper?
Artist 52 [7]
When you print handouts, the presentation is printed with one or more slides on each piece of paper. When you print handouts, it's best to have the presentation printed on them for those who can not view the presentation clearly to follow along with. This also serves as a great tool for people who missed the presentation to receive a handout later or for those there to take home and review. 
8 0
2 years ago
Each time an end user clicks a hyperlink, the browser generates a(n) _____ page request that is sent to the designated web serve
igomit [66]

Answer: HTTP GET

Explanation: There are many  HTTP(Hypertext Transfer protocol) requests sent to the server from the client .The page that gets request while the hyperlink page is clicked by the client, opens a HTTP GET page that belongs to the Internet protocol's(IP)suite by server. It is a process for the revival of the data from a particular server. The data does not get effected during the process of the retrieval.

3 0
3 years ago
Add me on xbox ahaha craig#6822 this is also just for points
Monica [59]

Answer:

sadly i dont have one:(

4 0
3 years ago
Read 2 more answers
Other questions:
  • Commands are organized into tabs on the
    8·2 answers
  • To color the h2 heading, what tag would you use?
    6·1 answer
  • Riya wants to save her project work in an external device so that she can show it to her class teacher. Help her to choose the d
    13·2 answers
  • Tcp takes a three-step approach to establishing a reliable communication. first, from the transport layer of the sending device
    12·1 answer
  • How does abstraction help us write programs
    11·1 answer
  • Including the word OR will make a search less specific.<br> O False<br> O True
    8·2 answers
  • Why was the tesla model s help change the was we see EV
    12·1 answer
  • Question 1 of 10
    15·1 answer
  • Difference between electrical and electronic devices
    15·2 answers
  • you want to run your campaign for your dry-cleaning service across three different publishers, each with different video creativ
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!