answersLogoWhite

0

#include<iostream>

#include<vector>#include<string>

int main()

{

std::vector<std::string> names;

for (int loop=0; loop!=10;)

{

std::cout << ++loop << " enter a name: ";

std::string name;

std::cin >> name;

names.push_back (name);

}

names.sort();

std::cout << "Sorted names:" << std::endl;

for (auto name : names)

std::cout << name << std::endl;

}

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Engineering

Print the sorted output on the console?

Do, if you want to.


How do you solve no console in java i have already enabled java console in java window from control panel but whenever i run my java program i keep receiving a no console message?

If you have enabled the Java Console in the Java Control Panel but are still not seeing the console when running your Java program, there are a few possible reasons for this issue. Firstly, ensure that your Java program is actually printing output to the console using System.out.println() statements. Additionally, check if your program is running in an environment that supports console output, such as a terminal or command prompt. Finally, make sure that your program is not terminating too quickly before you can see the console output, as this can sometimes give the appearance of no console being available.


Q2 Differentiate between formatted and unformatted you input and output functions?

Formatted input and output functions in programming languages allow for specific formatting options to be applied to the data being read from or written to the console. These functions enable the programmer to control the appearance of the data, such as specifying the number of decimal places when outputting a floating-point number. On the other hand, unformatted input and output functions simply read or write data without any specific formatting instructions, resulting in a more basic representation of the data on the console. The choice between formatted and unformatted functions depends on the desired level of control over the appearance of the data being processed.


How do you get eclipse to put its output in a command line console window?

Any program you run in eclipse will direct standard output to the eclipse console window. If you want to run it in a cmd window (Windows) or a shell (*NIX), then you need to run the program yourself from outside of eclipse.


How could Java classes direct program messages to the system console but error messages say to a file?

Sytem.out amd System.err is used to get the output, and refer to standard output strem and which is by default console ... u can send the output to any other stream or log file either by importing java.io.file and show the output to the console and run time error to any file using exception handling .... or u can give the command while running the program which will redirect this to log file as ... java ClassName 2error.log this will send error message to error.log file and output to console. ... u can send both the output and error to log file as... java ClassName output.log 2 error.log ... here ClassName is the name of the calss file which u wanted to execute

Related Questions

What is console application in c sharp?

The console application in C sharp(C#) is a simple application which takes input and returns output on a command line console, with the following data streams: standard input, standard output, and standard error.


Which of the following are the four major functions of a computer?

input processing storage output


Sort a book list in a library based on the discipline USING C plus plus programming?

Write your own C++ functions for the following problems:o Sort a book list in a library based on the disciplineo Print the sorted output on the console


Print the sorted output on the console?

Do, if you want to.


What does console header file does?

By writing console header file, if you mean to say about conio.h, then conio.h contains functions related to console input and output like clrscr() to clear the screen, getch() to get a character without enter key being pressed, getche() same as getch() but it shows the character entered.


What types of functions has a constant first difference between output values?

It doesn't make sense to type "the following..." if you don't provide a list.


What process do you need to have the following output?

The process that you need to do the following output depends on what the output is. The process you do to get one output would not be the same process you do to get a different output.


What is the full form of conioh?

Console Input Output Header


What do exclamation marks output to the console mean?

The transfer is working.


What is cprintf in graphics?

cprintf is to the console, printf to stdout (standard output). The only difference is stdout can be redirected but the console cannot.


In unix where the standard output is usually directed?

The current terminal or console.


Which header files contain declaration for the files input and output functions and the macros defined and that are used with file input and output functions?

stdio.h