WAP to display all the possible 3 digits no. using 0-9 without repeatition | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

WAP to display all the possible 3 digits no. using 0-9 without repeatition

all possible 3 digits no. without repeatition i also need the outcomes

6th Oct 2016, 9:33 AM
Hitesh Kumar
Hitesh Kumar - avatar
1 ответ
+ 1
#include <iostream> using namespace std; int main() { int a,b,c,i,j; for(i=100;i<=999;) { j=i; a=j%10;j/=10; b=j%10;j/=10; c=j%10;j/=10; if(a!=b&&b!=c&&a!=c) {cout<<i<<endl; i++;} else i++; } return 0; }
6th Oct 2016, 11:43 AM
Balaji Rs
Balaji Rs - avatar