Sunday, September 18, 2011

WAP to print all combinations of characters A,B,C


/*
  Name: WAP to print all combinations of characters A,B,C
  Author: Parveen Malik
  Date: 18/09/11 10:19
*/
#include<stdio.h>
#include<conio.h>


int main()
{
    char ch1, ch2, ch3;


for(ch1='A' ; ch1<='C' ; ++ch1)
{
            printf("\n");
for(ch2='A' ; ch2<='C' ; ++ch2)
for(ch3='A' ; ch3<='C' ; ++ch3)
printf(" %c%c%c", ch1, ch2, ch3);
}
getch( );
return 0;
}


OUTPUT: 



0 comments:

Post a Comment