C++ Program to Reverse a given Number

C++ Program to Reverse a given Number 

We have C++ Program to Reverse a given Number. We can reverse a number in C++ using loop and arithmetic operators. In this program, we are getting number as input from the user and reversing that number.

Practice Question :

1.Wap to check the number is prime or not 

2.Wap to check the character is vowel, consonants or special character. 

3.Wap to find the sum of n natural numbers.

4.Wap to print all prime number in given range taking range from users.

5.Wap to print the multiplicaton table .

source code :

using namespace std;
int main(){
    int num,rem,sum=0;
    cin>>num;
    while(num!=0){
        remnum%10;
        sum=sum*10 + rem ;
        num = num/10;

    }
    cout<<sum<<endl;

    return 0;
}
Previous
Next Post »