[C++] Inversul lui n - Tutoriale si exercitii - GAMELIFE România Jump to content

Recommended Posts

  • Members
Posted

Salut, mai jos atasez codul care afiseaza inversul unui numar n :

#include<iostream.h>
int n, inv,c;
void main()
{
cout<<„n=”;
cin>>n;
inv=0;
while(n!=0)
{
c=n%10;
inv=inv*10+c;
n=n/10;
}
cout<<„Inversul=”<<inv;
}

 

  • Like 1

eyixmpi.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...

Important Information