nibble and its reverse
//nibble and decimal number reverse a simple illustrations through program.
itprofessionalsrocks.blogspot.com
#include<iostream.h>
#include<conio.h>
void main()
{
int a,p,d,t,i=1,nib=0,rev=0;
cout<<"enter the decimal number" ;
cin>>a;
p=a;
while(a>0)
{
t=a%4;
nib=nib+t*i;
i=i*10;
a=a/4;
}
cout<<nib;
while(p>0)
{ d=p%10;
rev=rev*10+d;
p=p/10;
}
cout<<"number after reversing"<<rev;
getch();
}
itprofessionalsrocks.BLOGSPOT.COM
Comments
Post a Comment