+ 1
Help me with this one I'm a beginner
Sum and Return the result in reverse order int num, add, digit; cout <<Insert a number: cin>>num; while (num!=0) digit=num%10; num=num/10; //now adding an increment int ant = digit +add; //Now the new number in reverse order ant=antĂ10+digit; cout <<the new number is <<ant <<endl;
4 Answers
0
#include<iostream.h>
void main()
{
int num,digit,ant=0;
cout <<"Insert a number";
cin>>num;
while (num>0)
{
digit=num%10;
num=num/10;
ant=antĂ10+digit;
}
cout <<"the new number is "<<ant<<endl;
}
0
be careful with the syntax of every thing
like..
cout<<"....";
the quotation marks, semicolon etc..
0
Good answer, but I must pick the result of this operation and add an increment and give the result in reverse order.