Whats a problem? #include<iostream> #include<conio> void main () { int num; int
ID: 3617048 • Letter: W
Question
Whats a problem?#include<iostream>
#include<conio>
void main ()
{
int num;
int sum;
int n, rev;
clrscr();
cout << "Enter any numbers from 1 to10";
cin >> num;
sum=0;
rev=0;
cout << "Individual digits of thenumber is " << num <<": ";
while(num>0)
{n=num%10;
rev =rev*10+n;
num =num/10;}
while(rev>0)
{n=rev%10;
cout<< n << " ";
sum+=n;
rev =rev/10;
}
cout<<" Sum of the digits are: " << sum;
getch();
return0;
system("pause");
}
Explanation / Answer
please rate - thanks you were close. It looks like, from your code, you're using DEV C++ #include using namespace std; int main () { int num; int sum=0; int n=0, rev=0; cout > num; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.