Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to square a number in c++

#include<bits/stdc++.h>
using namespace std;
int main ()
{
    double A, n, R, Square_of_R;
    cin >> R;
    Square_of_R = pow(R,2);
    n = 3.14159;
    A = n * Square_of_R;
    cout << "A=" << fixed << setprecision(4) << A << endl; 
  	//printf("A=%.4lf", A);
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: print vector c++ 
Cpp :: number of digits in int c++ 
Cpp :: c++ get line 
Cpp :: c++ input 
Cpp :: c++ get maximum value unsigned int 
Cpp :: how to add c++14 in sublime text 
Cpp :: c++ vs g++ 
Cpp :: #define online judge in cpp 
Cpp :: how to empty string c++ 
Cpp :: setw c++ 
Cpp :: c define 
Cpp :: tree to array c++ 
Cpp :: pure virtual function in c++ 
Cpp :: C++ Conditions and If Statements 
Cpp :: c++ string slicing 
Cpp :: C++ Increment and Decrement 
Cpp :: cin exceptions c++ 
Cpp :: cpp map insert 
Cpp :: resize string c++ 
Cpp :: system("pause") note working c++ 
Cpp :: c ++ split_string 
Cpp :: why do we use pointers in c++ 
Cpp :: find pair with given sum in the array 
Cpp :: ue4 c++ replicate actor variable 
Cpp :: c++ sizeof 
Cpp :: c++ if statement 
Cpp :: vector::at() || Finding element with given position using vector in C++ 
Cpp :: how to increase array memory in c++ 
Cpp :: balanced brackets in c++ 
Cpp :: How to pass a multidimensional array to a function in C and C++ 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =