linecoding AMI with c programming. (WITH OUTPUT IMAGE)

#include<stdio.h>
#include<conio.h>

void main()
{
  char *a;
  int i=0,c=0;
  clrscr();

  printf("enter :");
  scanf("%s",a);

 while(*(a+i)!='\0')
 {
     if(*(a+i)=='1')
     {

       printf(" 0 ");

     }
     else
     { if(c%2==0)
{
printf("1");
c++;
}
else
{

printf("-1");
c++;

}

     }
  i++;
 }
getch();
}

Comments