Question: //The below code picks the first 3 elements and checks whether its divisible by 3 or not, and prints only elements which does. #include using

 //The below code picks the first 3 elements and checks whether

//The below code picks the first 3 elements and checks whether its divisible by 3 or not, and prints only elements which does.

#include

using namespace std;

int main()

{

cout

int base = 1000000000;

int top = 10000000000;

for (int c = base; c

if (c % 10 == 0) {

// additional condition to check

// if it has zero or repeated digit

//if (!hasRepeatedDigit(c)) {

int temp = c / 100000000;

int temp1 = c / 10000000;

int temp2 = c / 1000000;

int temp3 = c / 100000;

int temp4 = c / 10000;

int temp5 = c / 1000;

int temp6 = c / 100;

int temp7 = c / 10;

if (temp % 2 == 0 && temp1%3==0&& temp2 % 4 == 0 && temp3 % 5 == 0&& temp4 % 6 == 0 && temp5 % 7 == 0&&temp6 % 8 == 0 && temp7 % 9 == 0) {

cout

}

}

}

return 0;

}

I wanna delete any numbers repeat

like 12925222490

Microsoft Visual Studio Debug Console 1264564888 1264564888 12645648 1268843210 1268526428 1268582488 1268582498 1268589688 1268589698 1292046488 1292522488 1292522498 1292529688 1292529698 1292585670 1296601628 1296808018 1296888828 1296864888 1296064888 1296064898 1296548808 1296548898 1296548818 1296547288 main() cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!