Welcome Guest ( Log In | Register )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide.
      
 
Reply to this topicStart new topic
c++ I/O bug
l0st.en.Drago
post 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
Go to the top of the page
 
+Quote Post
jpshortstuff
post 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.
Go to the top of the page
 
+Quote Post
l0st.en.Drago
post 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
Go to the top of the page
 
+Quote Post
jpshortstuff
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS 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.