CAN ANYONE EXPLAIN THE OUTPUT OF THESE PROGRAMS:
/* Explain the output*/
#include<stdio.h>
int main()
{
if(printf(5+"Good")>0)
printf("morning");
return(0);
}
/*Debuh as per i/p o/p*/
#include<stdio.h>
int main()
{
long steps,fval,bstp,cnt1;
int num,unit,box[2][13],cnt2,cnt3,cnt4;
printf("Enter number:");
scanf("%d",&num);
num=num<1?1:num>12?num:12;
for(steps=1;cnt1=2;cnt1<=num;steps *= cnt1++);
for(cnt1=1;cnt1<=steps;cnt1++)
{
for(cnt2=1;cnt2<=num;cnt2++)
box[0][cnt2]=cnt2;
for(fval=steps;bstp=cnt1;cnt2=1;cnt2<num;cnt2++)
{
if(bstp=0)
{
cnt4=num;
while(box[0][cnt4]==0)
cnt4--;
}
else
{
fval/=num-cnt2+1;
unit=bstp+fval-1/fval;
bstp%=fval;
for(cnt4=0;cnt3=1;cnt3<unit;cnt3++)
while(box[0][cnt4++]==0);
}
box[1][cnt2]=box[0][cnt4];
box[0][cnt4]=0;
}
printf("\nseq. no. %d:",cnt1);
for(cnt2=1;cnt2<=num;cnt2++);
printf("%d",box[1][cnt2]);
return 0;
}
/*
SAMPLE INPUT/OUTPUT
Enter number: 3
seq. no.:1 2 3
seq. no.:1 3 2
seq. no.:2 3 1
seq. no.:2 1 3
seq. no.:3 1 2
seq. no.:3 2 1
*/
:!: :cool: :idea: :o