In this program we will declare an integer and then will take input from user for the integer. After this we will pass the integer in function where we will find its reverse number.
Program:
// Program By http://solutionscpp.blogspot.com// Author Mansoor Ahmed
// GMail ID: secguy000@gmail.com
#include<iostream>
using namespace std;
int reverse(int n);
int main()
{
int n=0, result=0;
cout<<"Enter Number: ";
cin>>n;
result=reverse(n);
cout<<"Reverse number is: " <<result <<endl;
}
int reverse(int n)
{
int temp=0, rev=0;
while(n!=0)
{
temp=n%10;
rev=(rev*10)+temp;
n=n/10;
}
return rev;
}
This code is helpful but I want some Example of C++ Programs;
ReplyDeletePrint Star pattern in C++
Print number pattern in C++
Prime number program in C++
Factorial Program in C++
I think u may searching for this...this is the program to print star in the following pattern.
Delete* * * * *
* * * *
* * *
* *
*
#include
using namespace std;
int main()
{ for (int i=5;i>=1;i--)
{cout<<\n";
}
for (int j=i;j<=i;j++)
{cout<<"*";
}
} return (0);
}
Phenomenal Blog! I may want to thank for the endeavors you have produced in composing this post. I'm trusting the exact same best work from you down the road too.open afp file
ReplyDeleteIf so, the best treatment is surgery, often with preop chemoradation. I would think this treatment would be available at any hospital.
ReplyDeleteNo doctor would give a prescription for anything without examining the patient, reviewing their records and getting a history and it certainly would not be a plant extract.
solve your afp problems
thank you for sharing useful post.
ReplyDeletec++ programming tutorial
welookups
*
ReplyDelete**
***
****
***** i am looking for this pattern code in c++
#include
Deleteusing namespace std;
int main()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
cout << "*";
}
cout << endl;
}
return 0;
}
Nice program . visit more good coding program collection Click Here
ReplyDelete