Completely Solved C, C++ Programs Assignment.




C Program to accept data in lower case and store the given data into file into upper case and print the data.

Filed Under:

Problem 93. C Program to accept data in lower case and store the given data into file into upper case and print the data.
#include<conio.h>
#include<stdio.h>
main( )
{
FILE *fp;
Char c;
fp=fopen(“data2.dat”,”w”);
clrscr( );
printf(“enter text”);
while((c=getchar( ))!=eof( ))
{
putc(toupper(c),fp)
}
fclose(fp);
fp=fopen(“data2.dat”,”r”);
while(1)
{
c=getc(fp);
if(c==eof( ))
break;
putchar(c);
}
getch( );
fclose(fp);
}

C compiler: gcc 4.1.2

 Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments