10

Oct 23, 2012 at 4:41pm
/*Hey.. This program is made for inserting a number of four digits then print the number in
reverse order.
made by: khaled oweis

This algorithm shows how it works :
1. insert number and declare a variable for it
2. Divide the number by ten and declare a variable for the mod
3. do step (2) four times and print the mod results by using (cout)
lets begin... */


#include <iostream>
#include <cmath>
using namespace std;
void main()
{
int number,c ; //declare a variable for the number and for the mod results

cout<<"insert a number of four digits : ";
cin>> number;

number= number/10 ;
c= (number mod 10)*10 ;

}


please help
Oct 23, 2012 at 4:46pm
The C++ modulus operator is %
Topic archived. No new replies allowed.