A program for repeating a sentence for 250 times
# include <iostream.h>
# include <string.h>
void main()
{ int x;
cout<<"Could you please say that again?";
for (x = 0; x < 250; x+1)
{
endl;
}
return;
}
Printable View
A program for repeating a sentence for 250 times
# include <iostream.h>
# include <string.h>
void main()
{ int x;
cout<<"Could you please say that again?";
for (x = 0; x < 250; x+1)
{
endl;
}
return;
}
Your program does not compile.
The correct header is <iostream>, and main() returns int, not void.Code:Thank you for testing your code with Comeau C/C++!
Tell others about http://www.comeaucomputing.com/tryitout !
Your Comeau C/C++ test results are as follows:
Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing. All rights reserved.
MODE:strict errors C++ C++0x_extensions
iostream.h, line 1: catastrophic error: #error directive:
<iostream.h> is not a Standard header, use <iostream> instead.
Note that when you change this header name, that identifiers such as
"cout" and "endl" will no longer work, as they are in namespace
"std", so use be "std::cout" and "std::endl" respectively. See
http://www.comeaucomputing.com/techtalk/#cnames for more details
#error <iostream.h> is not a Standard header, use <iostream> instead. Note that when you change this header name, that identifiers such as "cout" and "endl" will no longer work, as they are in namespace "std", so use be "std::cout" and "std::endl" respectively. See http://www.comeaucomputing.com/techtalk/#cnames for more details
^
1 catastrophic error detected in the compilation of "ComeauTest.c".
Compilation terminated.
In strict mode, with -tused, Compile failed
Regards,
Paul McKenzie
So please send the correct programming steps so that I can practice
Code:#include <iostream>
int main()
{
int x;
for (x = 0; x < 250; x++)
{
std::cout<<"Could you please say that again?" << std::endl;
}
return 0;
}
what is
x++
std::cout
return 0;