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]
4 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]4 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
When a virtual machine is
egoroff_w [7]

Answer:

Resources, RAM

Explanation:

May be another choice for resources but the second one is definently RAM

8 0
3 years ago
Photographs that are too dark or too light can be difficult to fix with photo-editing software.
Nana76 [90]
The answer is true :)
6 0
3 years ago
Read 2 more answers
When entering a function or formula in a cell, which of the first character you must type?
lions [1.4K]
When entering a function or formula in a cell, which of the first character you must type =
3 0
4 years ago
Read 2 more answers
What I'd the keyboard shortcut for applying bold font to a text selection ​
garik1379 [7]

It is the second option

3 0
3 years ago
When registering online for your classes you log onto to a website provided by your university. The computer and web browser tha
dedylja [7]

Answer:

Client, Server

Explanation:

The web browser acts as a client while the university computer acts as a server.

In a Server-Client model or architecture, the server provide the resources while the client request for the resources.

In this case, the university computer provide the resources that is to be consumed by the web browser after it must have made some request. The resources provided by the server (university computer) is based on the client (web browser) request.

6 0
3 years ago
Read 2 more answers
Other questions:
  • A tool that is used to search for and gather data from a page on the internet is called a ?
    11·2 answers
  • What is the value of the variable phones after the execution of the following code? phones = {'John': '5555555', 'Julie' : '7777
    6·1 answer
  • In microsoft windows when a window is minimized what happens to that window
    9·1 answer
  • Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished
    14·2 answers
  • Which Google Analytics visualization compares report data to the website average?A. Pivot viewB. Comparison viewC. Performance v
    8·1 answer
  • Why Is Jarvis Banned For Life? Literally Don't need to be forever!
    9·1 answer
  • You want to create Web pages that can easily adapt to and serve multimedia content to smartphones, tablets, gaming devices and s
    13·1 answer
  • Write an algorithm which gets a number A, if it is even, prints even, and if it is odd prints odd.
    7·1 answer
  • File names should be limited to 144 characters.<br><br> true or false
    12·1 answer
  • when an overridden method is called from within a subclass, it will always refer to the version of that method defined by the (a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!