I bought a "C++ for Dummies book" just started reading it and doing example code from the book in Code:Blocks 10.05, I'm running ubuntu 10.10 btw. anyway my exact code:
Code:
//
// Conversion - Program to convert temperature from
// Clesius degrees into Fahrenheit:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// enter the temperature in celsius
int celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;
// calculate conversion factor to convert celsius
// into fahrenheit
int factor;
factor = 212 - 32;
// use conversion factor to convert celsius
// into fahrenheit values
int fahrenheit;
fahrenheit = factor * celsius/100 +32;
// output the results (followed by a newline)
cout << "Fahrenheit value is:";
cout << fahrenheit << endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
system("PAUSE");
return 0;
}
it compiles ok, and runs the program properly by asking me for temperature in celsius, and reads me back the conversion in fahrenheit, however at the very end i get as output:
Code:
sh: PAUSE: not found
Anyone have any insight as to why this happens would be appreciated as the book states it should simply state "Press any key to continue..." which it does do but after the sh: PAUSE: not found message.
Bookmarks