
- Forum
- Programming Talk
- C and C++
- Print all combinations of 1,2,3 using for loop
Print all combinations of 1,2,3 using for loop
This is a discussion on Print all combinations of 1,2,3 using for loop within the C and C++ forums, part of the Programming Talk category; Write a program to print all combinations of 1,2,3 using for loop...
-
11-26-2011, 08:52 AM #1
- Join Date
- Feb 2006
- Answers
- 10
Print all combinations of 1,2,3 using for loop
Write a program to print all combinations of 1,2,3 using for loop
-
Martin, Try this and let me know
#include <stdio.h>
main() {
int a, b, c;
for (a=1; a<=3; a++) {
for (b=1; b<=3; b++) {
for (c=1; c<=3; c++) {
printf("\n %d %d %d", a, b, c);
}
}
}
}

Reply With Quote





