WAP to write character into file in lower case and display from file in uppercase
Defination:: WAP to write character into file in lower case and display from file in uppercase
Source Code ::
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *f;
char ch;
clrscr();
f=fopen("test.txt","w");
while((ch=getchar())!=EOF)
{
putc(ch,f);
}
fclose(f);
f=fopen("test.txt","r");
while((ch=getc(f))!=EOF)
{
printf("%c",ch-32);
}
fclose(f);
getch();
}
Source Code ::
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *f;
char ch;
clrscr();
f=fopen("test.txt","w");
while((ch=getchar())!=EOF)
{
putc(ch,f);
}
fclose(f);
f=fopen("test.txt","r");
while((ch=getc(f))!=EOF)
{
printf("%c",ch-32);
}
fclose(f);
getch();
}
WAP to write character into file in lower case and display from file in uppercase
Reviewed by Unknown
on
21:35
Rating:
No comments: