Powered By Blogger

Monday, May 4, 2009

C Programming

#include
#include
void main()
{
int a,bc;
clrscr();
char str[50],str1[50],s;
FILE *fp,*fo;
printf("Enter a file name what you want to convert:");
gets(str);
printf("Enter the name of converted file:");
gets(str1);
printf("Press 1 =chnge bad 2 for Right:");
scanf("%d",&bc);
fp=freopen(str,"r",stdin);
fo=freopen(str1,"w",stdout);

if(bc==1)
{

while((s=getc(fp))!=EOF)
{
if(s==' '||s=='.'||s==','||s==';')
printf("%c",s);
else
{
a=(int)s;
a=a+1;
putc(a,fo);
}
}
}
else if(bc==2)
{

while((s=getc(fp))!=EOF)
{

if(s==' '||s=='.'||s==','||s==';')
printf("%c",s);
else
{
a=(int)s;
a=a-1;
putc(a,fo);
}
}
}

}

0 comments:

About This Blog

This is an important blog about updated news about computer science and technology.

Blog Archive

Visitors

  © Free Blogger Templates Blogger Theme II by Ourblogtemplates.com 2008

Back to TOP