Sep 10, 2009

system programming-quardple


void main()
{
char str[50],b,c,op[20],op1[20],op2[20];
int a=49,i,j,k=1,opi=0,op1i=0,op2i=0;
clrscr();
printf("enter string\n");
gets(str);
while(strlen(str)>=3)
{
i=0;
while(1)
{
if(str[i]>=33&&str[i]<=47)
{
op1[op1i++]=str[i-2];
str[i-2]=a++;
op[opi++]=str[i];
op2[op2i++]=str[i-1];
for(k=i;k<=strlen(str);k++)
str[k]=str[k+1];
str[k]=NULL;
for(k=i-1;k<=strlen(str);k++)
str[k]=str[k+1];
str[k]=NULL;
break;
}
else
{
i++;
}
}
}
op[opi]=NULL;
op1[op1i]=NULL;
op2[op2i]=NULL;
printf("\nTriple no. operator operator1 oprator2\n");
for(i=0;i<strlen(op);i++)
printf("%d\t\t%c\t%c\t%c\n",i+1,op[i],op1[i],op2[i]);
getch();
}

1 comment:

  1. thank you jayesh for provide such codes.......

    ReplyDelete