Cpp Square Root Calculator

analyze0

Analyze_

Posted on June 6, 2022

Cpp Square Root Calculator

I like making calculators so I made one for square root. This uses the cmath package

Link

#include <cmath>
#include <iostream>
using namespace std;

int main() {
  string session = "y";

  while (session == "y") {
    int num = 0;
    cout << "What would you like to find the quare root of?\n";
    cin >> num;
    cout << sqrt(num) << "\nWould you like to continue session [y/n]?\n";
    cin >> session;
    cout << "\x1B[2J\x1B[H";
  } // end of session
  cout << "\x1B[2J\x1B[H";
  cout << "Ended session\n";
  return 1;
} // end of code
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
analyze0
Analyze_

Posted on June 6, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Cpp Square Root Calculator
calculator Cpp Square Root Calculator

June 6, 2022