Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Wednesday, April 21, 2010

This program reverses an integer value. (C++)


This program reverses an integer value. (C++)
 
# include < iostream.h> 
# include < conio.h> 
 
 
void revfunction(int num); 
 
 
void main() 
{
 
int nnum;
 
cout < < "this program will give the inverse of any number:"< < "\t";
 
cin>>nnum; 
 
revfunction(nnum); 
 
cout< < "\n"< < "Press a Key..."< < "\t";
 
getch();
 
}
 
 
void revfunction(int num)
 
{
 
int p=1,f,i;
 
while (p!=0)
 
{
 
 
p=num/10; 
 f=p*10; 
 i=num-f;
num=p; 
 cout< < i; 
 
}
 
 
}

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP