/* Programming to Print the starting position of the line*/
#include<stdio.h>
main()
{
        int i,b,l;
        char a[150];
        clrscr();
        for(i=0;(a[i]=getchar())!='$';i++);
        a[i]='\0';
        l=1;
        printf("The Starting position of the %d line : %d\n",l,0);
        for(b=i=0;a[i]!='\0';i++)
        {
                if (a[i]=='\n')
                {
                    l++;
                    b=i+1;
                    printf("the starting position of the %d line : %d\n",l,b);
                }
        }
        getch();
}

/*
  input:Taj is beautiful
        Welcome to India$
  output:
        the starting position of the 1 line : 0
        the starting position of the 2 line : 17
  */