| | |
what is wrong??
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2009
Posts: 6
Reputation:
Solved Threads: 0
C++ Syntax (Toggle Plain Text)
include <iostream> main () { int a, b; bool found; cout << "Enter two integers: " cin >> a >> b; if a > a*b && 10 < b found = 2 * a > b; else { found = 2 * a < b; if found a = 3; c = 15; if b { b = 0; a = 1; } }
Last edited by Ancient Dragon; Feb 2nd, 2009 at 10:00 pm. Reason: add code tags
Well for one, you didn't use code tags. When you post code, you should put it in code tags:
[ code=cplusplus]
// Your C++ Code Here
[ /code]
Secondly, your main function doesn't seem to return an int, or take command line parameters...
Third, you aren't using namespace std;, which is a problem, since you try to use cout and cin...
Fourth, your include is missing the #...
Hell, I guess the topic (and question) should be "what isn't wrong?"
[ code=cplusplus]
// Your C++ Code Here
[ /code]
Secondly, your main function doesn't seem to return an int, or take command line parameters...
Third, you aren't using namespace std;, which is a problem, since you try to use cout and cin...
Fourth, your include is missing the #...
Hell, I guess the topic (and question) should be "what isn't wrong?"
Last edited by Comatose; Feb 2nd, 2009 at 8:24 pm. Reason: fixing code tags
The basic structure should be more like
Also i think your IF statement is wrong...
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main () { // DO STUFF return 0; }
Also i think your IF statement is wrong...
If i am helpful, please give me reputation points.
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
YOUNG MAN THE WAY YOU USES IF STATEMENT IS JUST ROUGH YOU NEED PARENTHESIS FOR IS STATEMENT {MENTIONING UR MISAKES IN CAPITAL FORMAT)
FOR EXAMPLE
include <iostream>
main ()
{
int a, b;
INT bool found;
cout << "Enter two integers:
"cin >> a >> b;
if (a > a*b && 10 < b) I INTRODUCED THESE PARENTHESIS
found = 2 * a > b;
else
{
found = 2 * a < b;
if found (NO CONDITION APPLIED)E.G. IF (FOUND==0)
a = 3;
c = 15;
if b (AGAIN NO CONDITION APPLIED)
{
b = 0;a = 1;
}
}
IM SORRY BUT U NEED LOT OF PRACTICE.
KEEP WORKING HARD.
BEST OF LUCK.
FOR EXAMPLE
include <iostream>
main ()
{
int a, b;
INT bool found;
cout << "Enter two integers:
"cin >> a >> b;
if (a > a*b && 10 < b) I INTRODUCED THESE PARENTHESIS
found = 2 * a > b;
else
{
found = 2 * a < b;
if found (NO CONDITION APPLIED)E.G. IF (FOUND==0)
a = 3;
c = 15;
if b (AGAIN NO CONDITION APPLIED)
{
b = 0;a = 1;
}
}
IM SORRY BUT U NEED LOT OF PRACTICE.
KEEP WORKING HARD.
BEST OF LUCK.
![]() |
Similar Threads
- My CD-RW plays but won't burn. What could be wrong?? Help Please? (Storage)
- Retrieve email I sent to the wrong person (Web Browsers)
- Ram voltage wrong?? (Motherboards, CPUs and RAM)
- Am I going about this the wrong way (IT Professionals' Lounge)
- wats wrong with imesh??? (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: Having a hard time inputting a line of text into a char array
- Next Thread: Need help with writing a balance program.
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






