![](https://i-blog.csdnimg.cn/blog_migrate/fcdf8531a5c5dbce199cb95810741ef8.png)
数字反转c语言程序
Here you will get program to reverse number in C++.
在这里,您将获得使用C ++反转数字的程序。
#include<iostream>
using namespace std;
int main()
{
long n,rev=0,d;
cout<<"Enter any number:";
cin>>n;
while(n!=0)
{
d=n%10;
rev=(rev*10)+d;
n=n/10;
}
cout<<"The reversed number is "<<rev;
return 0;
}
Output
输出量
Enter any number:12674 The reversed number is 47621
输入任意数字:12674 反向数字为47621
翻译自: https://www.thecrazyprogrammer.com/2012/11/c-program-to-reverse-number.html
数字反转c语言程序