randomposts
Powered by Blogger.

write a program to Take number from user and print that number into reverse Using proper function in C++

No comments


#Header File include#include<stdio.h>
#Header File include#include<conio.h>
#Header File include#include<iostream.h>

class rev
{
     private :
           int no;
     public:
           rev(int n1)
           {
                no=n1;
           }

           void cal()
           {
                int a,s=0;

                while(no>=1)
                {
                     a=no%10;
                     s=(s*10)+a;
                     no=no/10;
                }

                cout<<"\nThe Reveres number are"<<s;___(Don't Missing Syntax required).
           }
};

void main()
{
     int num;
     clrscr();

     cout<<"Enter number to check revers number are:";___(Don't Missing Syntax required).
     cin>>num;

     rev r(num);

     r.cal();

     getch();
}

Note: *Remove The Sentence on this program ___(Don't Missing Syntax required).

No comments :

Post a Comment