Frame Sorting  

Posted in

#include "stdio.h"
struct frame
{
int fslno;
char finfo[20];
};
struct frame arr[10];
int n;
void sort()
{
int i,j,ex;
struct frame temp;
for(i=0;i<=n;i++) { ex=0; for(j=0;jarr[j+1].fslno)
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
ex++;
}
if(ex==0)break;
}
}
int main()
{
int i;

printf("Enter the no of frames");
scanf("%d",&n);
printf("Enter the frame sequence and contents\n");
for(i=0;i scanf("%d%s",&arr[i].fslno,&arr[i].finfo);
sort();
printf("The frame in sequence\n");
for(i=0;i printf("Sequence No:\t%d\t%s\t\n",arr[i].fslno,arr[i].finfo);
return 0;
}

This entry was posted at 4:44 AM and is filed under . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment

Reverse Engineering :Subscribe Now

Zts - ZTS

DISCLAIMER

This Blog is ONLY for educational purposes,
and any such codes/snippets provided are to be executed on
your sole discretion. The author is not responsible for the codes.