-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sanket143/reverse-py
Updated Reverse.py
- Loading branch information
Showing
305 changed files
with
10,092 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include<iostream> | ||
#include<cmath> | ||
using namespace std; | ||
|
||
double square(long int i) | ||
{ | ||
return (floor(sqrt(i))-sqrt(i)); | ||
} | ||
int main() | ||
{ | ||
double n; | ||
A : cout<<"Enter integer to be checked : "; | ||
cin>>n; | ||
if(floor(n)-n) | ||
{ | ||
cout<<n<<" is not an integer. Try again."<<endl; | ||
goto A; | ||
} | ||
if(square(n)==0) cout<<n<<" is a perfect square."<<endl; | ||
else cout<<n<<" is not a perfect square."<<endl; | ||
return 0; | ||
} |
Oops, something went wrong.