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.
8 20484
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.
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!
JosAH 11,448
Recognized Expert MVP
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
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.
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
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
JosAH 11,448
Recognized Expert MVP
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
I don't know if they want this, but I would do this: -
#include <iostream>
-
-
using namespace std;
-
-
int main() {
-
char numbers[10];
-
cout<<"Enter a number: ";
-
cin.getline(numbers, 10);
-
cout<<"The number you entered was: " << numbers;
-
cin.get();
-
}
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ricki Susic |
last post by:
Hi,
Can anyone help me to get my query printed when I parse ID.
Here is the code:
FILE: udskriv.php
<?php
|
by: Marco |
last post by:
I have a couple pages that have tables, whats best use echo to produce the
full table with the variables or is it best to just make the table in plain
html and use <?php echo ('$va'l); ?> when i need to see some value.
Example i have tables like this
echo '<div align="',$align,'"><table border="0" cellpadding="2"
cellspacing="0" width="',$largeur,'">';
echo '<tr><td bgcolor="',$titre_bgcolor,'"><font face="',$titre_face,'"...
|
by: mark |
last post by:
I'm trying to do something like this:
<?php
foreach($apples as $key => $value){
print("<td class=<?php if ($myvar==$key){print (class1);} else {print
(class2);} ?>>$value</td>");
}
?>
|
by: James Smith |
last post by:
What's the difference between Echo and Print?
J.
|
by: Alex Shi |
last post by:
Hi all,
Please take a look at following very simple script;
#!/usr/bin/php -q
<?
echo "Hello, world!\n";
if (!$tty) {
$tty = fopen('php://stdin', 'r');
}
| |
by: Aaron Reimann |
last post by:
I am trying to build a table using results from a database query.
Right now (code below), the code displays each result in a new <tr>. I
am wanted to display 3 results in one <tr> </tr>, and then create a new
<tr> with another 3, etc.
Here is human code:
print a <tr>
if only 1, 2 or 3 results have been returned, show the results and
print a </tr>
if 4, 5, and or 6 results have been returned, print <tr> and show
|
by: Tony |
last post by:
I'm just wondering why it seems most people use "echo" instead of "print". I
tend to use "print", probably because I started programming in BASIC back in
78, so it's just familiar.
Echo can take multiple expressions (as in "echo
$string1,$string2,$string3"), which apparently is a bit faster than multiple
concatenations. But for basic output, there doesn't seem to be a noticeable
difference. The speed test at...
|
by: Stefan Weiss |
last post by:
Hi.
function printx($str) {
echo $str;
}
true && printx("foo");
true && print("bar");
|
by: Steff |
last post by:
I am wandering if my code is making sense... I use a lot the print function.
Is it weird in this case where I have to display an array ? I thought it
would be better to have the entire array in php but now I am not sure if
that makes sense. Can you tell me please ?
<html>
<head>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |