I've entered everything, and have ran the program. It runs successfully, but the answer comes out as blank. Does anyone know why? There are no errors, but the answer is blank. If there is anyway to fix this, let me know!
Thank you for Replying so quickly! Hello World worked the first time I did it, so I assumed there was something wrong with my code, but it's showing the same result now.
Hmm, this is just a hunch, but I'm willing to bet that a black box pops up, flashes, then closes.
Try putting system("pause"); on the line above return 0;
To support this command you also need to include stdlib.h
Try...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
#include <stdlib.h>
usingnamespace std;
int main() {
int itemsOnHand= 5;
double itemPrice =3.50;
double total;
total = itemsOnHand * itemPrice;
cout << "The Total is: " << total;
system("pause");
return 0;
}
no, im on windows 7 64, I don't know much about linux other than that CS majors love it. I'm only starting college as a freshman in Computer Science in November, and I don't want to waste this summer. Can you tell me more about linux?
Ok, that one left my head spinning.
My only suggestion to that would be to try the classic Windows troubleshooting: Restart your pc. I know sometimes my compiler starts acting weird, and a quick restart fixes it. If it still doesn't work, then I'm clueless... :/
I actually know very little about linux. I was just asking because I do not know if the library's I was referencing would work on linux. Google is an excellent resource though ;)
Hmm, try recompiling your original code?
If that works, I may have included the wrong library or messed up the cpy/pst.
If it doesn't work, then your compiler is probably messed up. I am not familiar with Netbeans, so I can not help you troubleshoot that.