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

11y ago

What else can I help you with?

Continue Learning about Engineering

What are the two ways of formating of output in c?

In C, the two primary ways of formatting output are using printf() and fprintf(). The printf() function is used for standard output to the console, while fprintf() allows for formatted output to a specified file stream. Both functions utilize format specifiers to control the display of variables, such as %d for integers and %f for floating-point numbers. Additionally, sprintf() can be used to format output into a string instead of sending it directly to a console or file.


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 I/P functions: These functions allow us to supply the input in a fixed format and let us obtain the output in the specified form. Formatted output converts the internal binary representation of the data to ASCII characters which are written to the output file. Formatted input reads characters from the input file and converts them to internal form. Format specifications Data type Integer short signed short unsigned long signed long unsigned unsigned hexadecimal unsigned octal %d or %l %u %ld %lu %x %o Real float double %f %lf Character signed character unsigned character %c %c String %s Unformatted I/O functions: There are several standard library functions available under this category-those that can deal with a string of characters. Unformatted Input/Output is the most basic form of input/output. Unformatted input/output transfers the internal binary representation of the data directly between memory and the file


Where conioh is used?

Conioh is a library used in C programming for console input and output, particularly for manipulating the console screen in a text-based environment. It provides functions for handling keyboard input, text color, and screen positioning, making it useful for creating interactive command-line applications. Commonly, it's utilized in educational settings or simple games to enhance user experience in the console.

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


This manipulator is used to establish a field width for the value immediately following it?

The manipulator used to establish a field width for the value immediately following it is typically referred to as a field width specifier in formatting functions. In C++, for example, the setw manipulator from the &lt;iomanip&gt; library sets the width for the next output. This allows for better alignment of output in console applications by ensuring that numbers or strings occupy a specified number of characters, enhancing readability.


What are the two ways of formating of output in c?

In C, the two primary ways of formatting output are using printf() and fprintf(). The printf() function is used for standard output to the console, while fprintf() allows for formatted output to a specified file stream. Both functions utilize format specifiers to control the display of variables, such as %d for integers and %f for floating-point numbers. Additionally, sprintf() can be used to format output into a string instead of sending it directly to a console or file.


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.