Square root

By informaticar on Oct 18, 2008

Program for square root calculating Image

// Square Root
// Coded by informaticar

#include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    float a, b;
    cin >> a;
    if (a < 0)
    {
          cout << "Number is negative." << endl;
          }
          else
          {
              b = sqrt(a);
              cout << b << endl;
              }
              system("pause");
              return 0;
              }

Comments

Sign in to comment.
Hawkee   -  Oct 20, 2008

Doesn't look like any missing brackets, but the bracket spacing is a bit off.

More
 Respond  
^Neptune   -  Oct 20, 2008

You know, I have absolutely no knowledge of C++, but it looks like there are missing brackets at the end.

Don't yell at me if I'm wrong though. :(

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.