I wrote this C program for Win32/c compiler but while i'm trying run this using gcc in Linux machine or codepad.org it shows 'conio.h: No such file or directory compilation terminated' What are modification to be done to execute this program without including any other new includes like curses.h
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,j=0,k=0,n,u=0;
char s[100],c2,c[10];
char c1[3]={'a','b','c'};
clrscr();
printf("no of test cases:");
scanf("%d",&n);
for(u=0;u<n;u++)
{
printf("Enter the string:");
scanf("%s",s);
i=0;
while(s[i]!='\0')
{
if(s[i+1]=='\0')
break;
if(s[i]!=s[i+1])
{
for(j=0;j<3;j++)
{
if((s[i]!=c1[j])&&(s[i+1]!=c1[j]))
{
c2=c1[j];
}
}
s[i]=c2;
for(k=i+1;k<100;k++)
{
s[k]=s[k+1];
}
i=0;
}
else
i++;
}
c[u]=strlen(s);
}
for(u=0;u<n;u++)
printf("%d\n",c[u]);
getch();
}
I did not look at your code to see if it needs the three functions. But this is the simplist way to get them. There is normaly a better way than using getch(). clrscr() is also no fun when you clear my screen !
getch()