removes comments from the given program and prints to the other file
#include<stdio.h>
void main(int argc,char *argv[])
{
FILE *in,*out;
char ch1,ch2;
int f=0;
in=fopen(argv[1],"r");
out=fopen(argv[2],"w");
while(!feof(in))
{
ch1=getc(in);
if(ch1=='/')
{
if((ch2=getc(in))=='/')
{
while((ch2=getc(in))!='\n')
{
;
}
}
else
if(ch2=='*')
{
while((ch2=getc(in))!=EOF)
{
if(ch2=='*')
{
if((ch2=getc(in))=='/')
f=1;
}
if(f==1)
break;
}
}
}
else
{
putc(ch1,out);
}
}
fclose(in);
fclose(out);
}