Saturday, 12 December 2015

WRITE a program that show all the possible combination of 123 with nested loop in c++

#include<iostream>
#include<conio.h>
using namespace std;
main ()
{ int i=1,j=1,k=1,l=1;
for(i=1;i<=3;i++)
{for(j=1;j<=3;j++)
{
for(k=1;k<=3;k++)

 cout<<"\t"<<i<<j<<k; }
}
getch();}

No comments:

Post a Comment