Alphabetical Arrangement

/*Alphabetical arrangement */
#include
#include
#include
void main()
{
char string[50];
char temp;
int i,j,l;
printf("\nEnter any string: ");
scanf("%s",string);l=strlen(string);
for(i=0;i{
for(j=0;j{
if(string[j]>string[j+1])
{
temp=string[j];
string[j]=string[j+1];
string[j+1]=temp;
}
}
}printf("\n\nAlphabetical arrangement makes: ");
puts(string);
getch();
}

PROGRAM TO GENERATE PASCAL'S TRIANGLE

/* PROGRAM TO GENERATE PASCAL'S TRIANGLE*/
#include
#include
void main()
{
int binom,q,r,x,num;binom=1;
q=0;clrscr();
printf("\n\t\t\tPASCAL'S TRIANGLE ");
printf("\nInput the number of rows :");
scanf("%d",&num);
printf("\nPascal's triangle:\n ");
while(q for(r = 10 ; r>q ; r--)
{
printf(" ");
}
for(x=0;x<=q;x++)
{
if((x==0)(q==0))
{
binom=1;
}
else {
binom=(binom*(q-x+1))/x;
}
printf(" %d ",binom);
}
printf("\n\n");++q;}getch();}