//Read a text until $ and convert , to ;
#include<stdio.h>
main()
{
	int i,j;
	char a[100],b[100];
	clrscr();
	printf("enter the input\n");
	i=0;
	scanf("%c",&a[i]);
	while(a[i]!='$')
	{
		i++;
		scanf("%c",&a[i]);
	}
	printf("after the conversion\n");
	a[i]='\0';
	i=0;
	j=0;
	while(a[i]!='\0')
	{
		if (a[i]==',')
			b[j]=';';
		else
			b[j]=a[i];

		i++;
		j++;
	}
	b[j]='\0';      //Print Loop
	j=0;
	while(b[j]!='\0')
	{
		printf("%c",b[j]);
		j++;
	}

	getch();
}

/*      input : i ,we,
	Process of the above program
	loop process:
	step 1: i=0,j=0 so a[0]=i then the condition is false so b[0]=i
		i and j will be incremented
	step 2: i=1,j=1 so a[1]=' ' then the condition is false so b[1]=' '
		i and j will be incremented
	step 3: i=2,j=2 so a[2]=, then the condition is false so b[2]=;
		i and j will be incremented
	step 4: i=3,j=3 so a[3]=w then the condition is false so b[3]=w
		i and j will be incremented
	step 5: i=4,j=4 so a[4]=e then the condition is false so b[4]=e
		i and j will be incremented
	step 6: i=5,j=5 so a[5]=, then the condition is true so b[5]=;
		i and j will be incremented

	output: i ;we ;
*/
/* Exercise 1: Read a text until $ and if ',' then skip
		Hint: input -> idli, dosa, vadai.
		      output-> idli dosa vadai.
*/