469,338 Members | 8,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

Echo print

Sheepman
I'm in my first C++ class. I am supposed to have the program I'm writing "echo print" to the screen. What does that mean, I can't find any reference to it in my book.
Jun 22 '07 #1
8 18695
Silent1Mezzo
208 100+
I'm in my first C++ class. I am supposed to have the program I'm writing "echo print" to the screen. What does that mean, I can't find any reference to it in my book.
Well my guess is that they're talking about the echo command.
An example of this would be: echo hello
On the screen you would see the words "hello"

I think they want you to write a program that uses this command and prints something onto the screen.

If this is so research the system() command.
Jun 22 '07 #2
Here's how the question is stated.

Write a complete C++ program...Ask the user to enter integers. Echo print each integer to the screen. If the interger...

I can make the program do whats ask with the integers. I'm just not sure about the bold statement.

Thanks for the quick response!
Jun 22 '07 #3
JosAH
11,448 Expert 8TB
Here's how the question is stated.

Write a complete C++ program...Ask the user to enter integers. Echo print each integer to the screen. If the interger...

I can make the program do whats ask with the integers. I'm just not sure about the bold statement.

Thanks for the quick response!
I guess your program is supposed to print (echo) what the user had entered;
e.g. if the user entered 4 5 6 the program is supposed to echo (print) 4 5 6 again.

kind regards,

Jos
Jun 22 '07 #4
Silent1Mezzo
208 100+
Here's how the question is stated.

Write a complete C++ program...Ask the user to enter integers. Echo print each integer to the screen. If the interger...

I can make the program do whats ask with the integers. I'm just not sure about the bold statement.

Thanks for the quick response!
Ok so yes. echo is a system statement that prints whatever's after it.

Basically you'll want to get the numbers from the user. Then uses the system() and echo command to print it.
Jun 22 '07 #5
I don't think they necessarily mean to use the system echo command , but to just print out the same integers the user entered in the same order, probably using std::out , since you will be using std::in to input the ints
Jun 22 '07 #6
Silent1Mezzo
208 100+
I don't think they necessarily mean to use the system echo command , but to just print out the same integers the user entered in the same order, probably using std::out , since you will be using std::in to input the ints

If they didn't mean to use the sys echo command then why did they say "Echo print each integer"? That to me sounds like it is the echo command
Jun 22 '07 #7
JosAH
11,448 Expert 8TB
If they didn't mean to use the sys echo command then why did they say "Echo print each integer"? That to me sounds like it is the echo command
My guess is that the verbs 'echo' and 'print' are used as synonyms here. Two
synonyms next to each other are confusing.

kind regards,

Jos
Jun 23 '07 #8
niskin
109 100+
I don't know if they want this, but I would do this:
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     char numbers[10];
  7.     cout<<"Enter a number: ";
  8.     cin.getline(numbers, 10);
  9.     cout<<"The number you entered was: " << numbers;
  10.     cin.get();
  11. }
  12.  
Jun 23 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Ricki Susic | last post: by
6 posts views Thread by Marco | last post: by
12 posts views Thread by mark | last post: by
6 posts views Thread by James Smith | last post: by
3 posts views Thread by Alex Shi | last post: by
4 posts views Thread by Aaron Reimann | last post: by
13 posts views Thread by Tony | last post: by
3 posts views Thread by Stefan Weiss | last post: by
1 post views Thread by Steff | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.