Type Here to Get Search Results !

1. write a program decode the stuff data.

 

#include<stdio.h> #include<string.h> main()

{

int i,j,k,l,n,count;

char s[100],cs[50]; clrscr();

printf("\n ENTER THE STUFFED STRING :");

gets(s); n=strlen(s); printf("\nTHE STRING IS\n"); for(i=0;i<n;)

{

if(s[i]=='$')

{ i++;

count=(s[i]-'0')*10+(s[i+1]-'0'); if(count<5)

{ clrscr();

printf("INVALIDE MESSAGE");

exit(1);

}

while(count>0)

{

printf("%c",s[i+2]); count--;

}

i=i+3;

}

else

{

printf("%c",s[i]); i++;

}

}

getch();      }

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Featured post

M

M