aaabb to32 ,aabbb to a2b3 convert in c-asr
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char s[10],c[10]; int i=1,j,tmp[10]; int p[10]; static int x,num=0; s[0]='*'; c[0]='*'; tmp[0]=0; printf("\nEnter a string\n"); while(1){ s[i]=getchar(); //reads single characters until enter pressed if(s[i]==s[i-1]) //checks the previous character matched or not { x++; tmp[num]=x; //increment x as much as character matches the previous characters insert into tmp } else{ x=1...
Comments
Post a Comment