for statements

i want to know the problem with my code, am having error runing this code, i want to print out all combination on a bag lock. the permutations should have 3 digits each ranging from 0 - 9.


#include <iostream>
using namespace std;
int main(){
for(int first = 0 ;first < 10; first++){
for(int second = 0 ;second < 10; first++ ){
for(int last = 0;last < 10; last++){
cout <<first <<"--"<<second<<"--"<<last<<endl;
if(first == 9 && second == 9 && last == 9){
cin.get();
}
}//end of last statement
}//end of second statement
}// end of first statement
return 0;
}
Last edited on
 
for(int second = 0 ;second < 10; first++ ){


first++ should be second++
thank you very much chervil i didn't even realize it
Last edited on
Topic archived. No new replies allowed.