c++ I/O bug |
![]() ![]() |
c++ I/O bug |
May 10 2008, 01:36 PM
Post
#1
|
|
|
Geek in Training ![]() ![]() Posts: 61 From: Tijuana, Baja California OS: Windows XP Pro SP2 |
thanks
This post has been edited by l0st.en.Drago: May 12 2008, 05:35 PM |
|
|
May 11 2008, 09:06 PM
Post
#2
|
|
|
Member ![]() ![]() Posts: 14 From: UK OS: XP |
Try switching the 'greater than' arrows round:
QUOTE cout << "This is a C++ program!"; Hope that helps. |
|
|
May 11 2008, 09:33 PM
Post
#3
|
|
|
Geek in Training ![]() ![]() Posts: 61 From: Tijuana, Baja California OS: Windows XP Pro SP2 |
thanks
This post has been edited by l0st.en.Drago: May 12 2008, 05:35 PM |
|
|
May 12 2008, 12:24 AM
Post
#4
|
|
|
Member ![]() ![]() Posts: 14 From: UK OS: XP |
If you are trying to get the users to type in 2 numbers, you need to use cin.
CODE #include <iostream> using namespace std; int main(){ float num1, num2, ans; cout<<"Enter two numbers to add\n"; cin >> num1; cin >> num2; ans=num1+num2; cout<<ans<<endl; system("pause"); } Hope thats what you were trying to do. |
|
|
![]() ![]() |
|
Time is now: 19th July 2008 - 08:35 PM |
| Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. |