answersLogoWhite

0


Best Answer

#include<iostream>

#include<sstream>

int main()

{

unsigned num;

while (true)

{

std::cout << "Enter a number: ";

std::string input;

std::cin >> input;

std::stringstream ss;

ss << input;

if (ss>>num) break;

std::cerr << "Invalid input.\n";

}

for (int i=0; i<num; ++i)

std::cout << "Well done!\n";

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a c plus plus program to display n congratulatory messages where n is a user input value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

A program that uses prompting messages to direct the user's input is running in?

Interactive mode


An assembly language program that will take three decimal input and display minimum of them?

program that take three decimal number as input and find the largest among them in assembly language


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Write a program that accepts as inputs the edges of a graph and then draws the graph using a computer graphics display?

hey i m going to give a program that accepts edges a input and then it draws the graph using a computer graphics display...


What is an input display on action replay ds?

What is Input Display on action replay ds?


How does a 3-D CAD solid model program display the progression of work involved in creating a model?

If you input all of the correct numbers then the program will then analyze it and produce a 3-D graph of the date you've put it. You must keep accurate data over your work period to input into the program.


What is legal input?

In a computer program, a legal input is something that can be put into a program and it will work. An illegal input may crash the program.


Is a display adapter a input or output device?

A display ADAPTER is neither. The Display is an output device.


Determine the highest of the three input numbers using flowchart?

(start) /a=0 c=0\ \b=0 / /input a/ /input b/ /input c/ /a&gt;b\ no /b&gt;c\ yes /display b/ -&gt; (a) \ / \ / yes no /a&gt;c\ no /display c/ -&gt; (a) \ / yes /display a/ &lt;- (a) (end)


Which is not a way to input data into a program?

without understanding the program giving a input


C program to display a number entered by user as it is without skipping the zeros preceding the number?

// Define and initialize input buffer char inputBuffer[256]; memset(inputBuffer, '\0', 256); // Get input scanf("%s", inputBuffer); // Display exactly what the user typed in printf("%s\n", inputBuffer);


What is the program to find sum of n natural numbers in c plus plus?

Initialise an unsigned integer to zero. As each number is input, increment the running total accordingly. When all numbers are input, display the total.