I need to find numbers which are divisible by its own digits C++
this is the code i have now: (the problem is that it displays numbers that are divisible only by LAST its digit).
#include
using namespace std;
int main()
{
int n,d;
for (n=0; n<1000; n++){
int temp=n;
d=temp%10;
if(d!=0){
temp/=10;
if(n%d==0)
{ cout<
}
}
}
Answers
Answered by
0
Answer:
plz write it in short version
Similar questions
Biology,
6 months ago
Math,
6 months ago
Math,
6 months ago
Political Science,
11 months ago
Physics,
11 months ago
Political Science,
1 year ago
Chemistry,
1 year ago