3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by daviddoria
0

well you may need <cmath>, ofcourse <iostream> well that is what i can think of at the moment..but depending on the functions you are going to use, only <iostream> will be needed. You will need to identify the errors from your code or give us a clue about what you have done

0

make a file using any text editor (emacs, vi, gedit) called test.cpp

#include <iostream>
using namespace std;

double Multiply(double a, double b)
{
return a*b;
}

int main()
{
double c = Multiply(10,2);
cout << "10 * 2 = " << c << endl;
return 0;
}

then to compile, from a terminal type

g++ test.cpp -o test

then to run the program

./test

hope this helps

dave

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.