sqrt function in c++ unix

Posted: February 1, 2012 in Programming
Tags: , , , , ,

if you are using unix environment and writing c++ codes we need to make few changes.

1. while adding header file use #include instead #include

2. use namespace so that we can avoid using std in each cin and cout statement

using namespace std;

3. use g++ compiler instead of gcc.

4. if you are using sqrt , pow functions add math library and compile as follows

g++ -lm filename
./a.out

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s