0
5.2kviews
WAP to print all possible combinations of 1,2,3 using nested loops.

Subject : Structured Programming Approach

Title : Control Structures

Difficulty : Medium

1 Answer
1
102views

Program:

#include<stdio.h>

#include<conio.h>

void main()

{

    int i,j,k;

    clrscr();

    for(i=1;i<=3;i++)

    {

        for(j=1;j<=3;j++)

        {

            for(k=1;k<=3;k++)

            printf(ā€œ\n%d%d%dā€,i,j,k);

        }

    }

    getch();

}

Output:

111

112

113

121

122

123

131

132

133

211

212

213

221

222

223

..
..

(and so on.)
Please log in to add an answer.