Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

C / C++ Forum


You are currently viewing our C / C++ Forum as a guest. Please register to participate.
Login



Reply
Problem running simple c++ program
Old 12-01-2011, 06:13 AM Problem running simple c++ program
Junior Talker

Posts: 4
Trades: 0
Code:
#include <iostream>
using namespace std;

int main() 
{
    double xin;
    cout << " For Option 1 Enter 1" << endl;
    cout << " For Option 2 Enter 2" << endl;
    cout << " To Exit Enter 3" << endl;
    cin>> xin;
    
while (xin != 3)
{
    if (xin == 1)
    {
        cout << "Entered in the Deposit Section" << endl;
        cout << " For Option 1 Enter 1" << endl;
        cout << " For Option 2 Enter 2" << endl;
        cout << "To Exit Enter 3"; << endl;
        cin>> xin; 
    }
    
    else if (xin==2)
            cout << "Entered in the Withdraw section " << endl;
    else
            cout << " Invalid Entry !" ; 
    
}
    system("pause");
    return 0;

}
yourwebsolution is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-01-2011, 06:29 AM Re: Problem running simple c++ program
chrishirst's Avatar
Defies a Status

Posts: 44,055
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And the problem is??????????????????????????
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-01-2011, 06:40 AM Re: Problem running simple c++ program
Junior Talker

Posts: 4
Trades: 0
I have attached a screenshot with the errors. Thanks for your help.
Attached Images
File Type: jpg phpwIxmzAAM.jpg (13.0 KB, 11 views)
yourwebsolution is offline
Reply With Quote
View Public Profile
 
Old 12-01-2011, 06:42 AM Re: Problem running simple c++ program
chrishirst's Avatar
Defies a Status

Posts: 44,055
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And I'm sure it would be really handy if it was actually readable!!!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-01-2011, 06:44 AM Re: Problem running simple c++ program
chrishirst's Avatar
Defies a Status

Posts: 44,055
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
General note.

Look people YOU are the one with the problem, we give our time freely to assist YOU the least you could do is HELP instead of putting obstacles in the way so we get hacked off and leave your question alone.

Which is what I am now doing!!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-01-2011, 06:46 AM Re: Problem running simple c++ program
Junior Talker

Posts: 4
Trades: 0
It said "parse error: expected expression"
yourwebsolution is offline
Reply With Quote
View Public Profile
 
Old 12-04-2011, 08:45 PM Re: Problem running simple c++ program
King Spam Talker

Posts: 1,110
Name: Paul W
Trades: 0
cout << "To Exit Enter 3"; << endl;

semi colon after 3"
__________________
Great music:
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 04-24-2012, 06:02 PM Re: Problem running simple c++ program
Novice Talker

Posts: 13
Trades: 0
replace
cout << "To Exit Enter 3"; << endl;
to
cout << "To Exit Enter 3" << endl;
It will solve your problem.
deadhunt is offline
Reply With Quote
View Public Profile
 
Old 05-20-2012, 06:27 AM Re: Problem running simple c++ program
Junior Talker

Posts: 1
Trades: 0
You are comparing double value with integer value.This may be OK.
remove semicolon after "to exit enter 3" and may be problem with system("pause");
sumtau is offline
Reply With Quote
View Public Profile
 
Old 05-20-2012, 11:02 PM Re: Problem running simple c++ program
King Spam Talker

Posts: 1,110
Name: Paul W
Trades: 0
Quote:
Originally Posted by sumtau View Post
You are comparing double value with integer value.This may be OK.
remove semicolon after "to exit enter 3" and may be problem with system("pause");

Doible to int is ok, problems usually come when comparing floats.
__________________
Great music:
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem running simple c++ program
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31860 seconds with 12 queries