Members Zekarjah Posted April 30, 2020 Members Posted April 30, 2020 Salut, in codul urmator o sa va arat cum se afla daca un numar este palindrom : #include<iostream.h> int n,inv, c, copie; int main() { cout<<„n=”; cin>>n; copie=n; while(n!=0) { c=n%10; inv=inv*10+c; n=n/10; } if(copie==inv) cout<<„Palindrom”; else cout<<„Nu”; }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now