Exp 6 Selective Repeat
#include<stdio.h>
#include<conio.h>
void main()
{
int w,i,f,frames[50];
clrscr();
printf("Enter window size: ");
scanf("%d",&w);
printf("\nEnter number of frames to transmit: ");
scanf("%d",&f);
printf("\nEnter %d frames: ",f);
for(i=1;i<=f;i++)
scanf("%d",&frames[i]);
printf("\n frames will be sent in the following manner \n\n");
printf("After sending %d frames sender will get the acknowledgement \n\n",w);
for(i=1;i<=f;i++)
{
if(i%w==0)
{
printf("%d\n",frames[i]);
printf("Acknowledgement received \n\n");
}
else
printf("%d ",frames[i]);
}
if(f%w!=0)
printf("\nAcknowledgement of above frames sent is received by sender\n");
getch();
}
#include<conio.h>
void main()
{
int w,i,f,frames[50];
clrscr();
printf("Enter window size: ");
scanf("%d",&w);
printf("\nEnter number of frames to transmit: ");
scanf("%d",&f);
printf("\nEnter %d frames: ",f);
for(i=1;i<=f;i++)
scanf("%d",&frames[i]);
printf("\n frames will be sent in the following manner \n\n");
printf("After sending %d frames sender will get the acknowledgement \n\n",w);
for(i=1;i<=f;i++)
{
if(i%w==0)
{
printf("%d\n",frames[i]);
printf("Acknowledgement received \n\n");
}
else
printf("%d ",frames[i]);
}
if(f%w!=0)
printf("\nAcknowledgement of above frames sent is received by sender\n");
getch();
}
Comments
Post a Comment