Help in Command Line Argument, Multiple Sum Digits

Hey everybody I'm fairly new to C++ and have been understanding until Ive hit this rock. Im trying to figure out how to indicate whether or not a first command line argument interpreted as an integer is a multiple of the sum of its own digits. I understand that logic as if you type 20 = 2(2+0) is a yes but i feel hopeless trying to set it up. Any tips, hints or help i would love so much. Thanks anyone for a comment in advance.
Last edited on
Oh and this is all i have so far =(

#include <iostream>
using namespace std;


int main(int argc, char*argv[])
{

int num, rem, sum = 0;

cout << "Enter a number :"<<endl;
cin >> num;

while(num!=0)
{
rem=num%10;
num=num/10;
sum=sum+rem;
}

cout << sum << endl;

return 0;
}
Topic archived. No new replies allowed.