
This program accepts any valid C Program as an input and removes the comments and blanks from it. The output is a program that has no comments and blank lines.
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<dos.h>
void main()
{
FILE *a,*b;
FILE *a,*b;
char fname[20],ch,tch=NULL,tch1=NULL;
int flag1=0,flag=0,count=0,count1=0,count2=0;
clrscr();
clrscr();
printf(“Enter the file name (.C or .TXT)\n”);
gets(fname);
a=fopen(fname,”r”);
if(a==NULL)
{
puts(“Cannot open the source file!!!”);
delay(500);
exit(1);
}
b=fopen(“target.c”,”w”);
if(b==NULL)
{
puts(“Cannot create target file!!!”);
delay(500);
exit(1);
}
while(1)
while(1)
{
ch=fgetc(a);
if(ch==EOF) break;
else
else
{
if(ch==’\n’)
if(ch==’\n’)
{
count1=1;
tch1=ch;
continue;
}
else if(ch==’\n’&& count1==1)
else if(ch==’\n’&& count1==1)
continue;
else if(ch==’/'&&count==0)
{
flag1=1;
tch=ch;
count=1;
continue;
}
else if(ch==’*'&& flag1==1)
else if(ch==’*'&& flag1==1)
{
flag=1;
flag1=0;
tch=NULL;
}
else if(ch==’*'&&flag==1)
else if(ch==’*'&&flag==1)
{
count2=1;
count=1;
continue;
}
else if(ch==’/'&&count2==1)
else if(ch==’/'&&count2==1)
{
flag=0;
count=0;
tch=NULL;
continue;
}
else if(count==1&&flag==1)
else if(count==1&&flag==1)
count=0;
else if(flag1==1)
else if(flag1==1)
flag1=0;
}
if(flag!=1)
if(flag!=1)
{
if(tch>0)
fputc(tch,b);
if(tch1>0)
fputc(tch1,b);
tch1=NULL;
tch=NULL;
count=0,count1=0,count2=0;
fputc(ch,b);
flag1=0,flag=0;
}
}
puts(“DONE!! OP FILE IS \”TARGET.C\”\n”);
}
puts(“DONE!! OP FILE IS \”TARGET.C\”\n”);
fcloseall();
getch();
}
Most of us are familiar with the virus that used to block Orkut and Youtube site. If you are curious about creating such a virus on your own, here is how it can be done. As usual I’ll use my favorite programming language ‘C’ to create this website blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.
YouTube is undoubtedly the most preferred website to share and watch favorite videos. Most users prefer to watch the videos online, while a few others like me, would like to download them so that, they can be saved and retained. Well, if you are one among those few who would like to download the videos from YouTube, then here is a way to do that.
Ever copied a code snippet or text from the web and forgot to paste it before you copied something else? Well, all of us will have an experience of something like this, where we want to desperately retrieve those information that was once copied to the clipboard. But since Windows clipboard will only remember the last item that was copied onto it, it would seem impossible to recover the information that was copied earlier. However, this problem can be solved using an alternative clipboard manager in place of the default one.
This tool is a powerful clipboard manager which will store every piece of information that was copied to the clipboard including text, images or any other file. Clipdiary automatically loads upon Windows startup and maintains a database to store the history of all copied items.










