source file name: comb3dig.C
#include<stdio.h>
void main()
{
int a,b,c;
int n;
clrscr();
printf(" Forming 3-digit numbers:\n ");
for(a=1;a<=3;a++)
{
for(b=1;b<=3;b++)
{
for(c=1;c<=3;c++)
{
n=100*a+10*b+1*c;
if(a==b || a==c || b==c )
continue;
printf("\n %d",n);
}
}
}
getch();
}
output:
0 Comments
Post a Comment