12-4 :
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n;
char a;
FILE *fp;
fp = fopen("letter.txt","w");
if(fp == NULL)
{
printf("error");
exit(1);
}
fprintf(fp,"identification number\tGrade\n");
while(n!=-999)
{
printf("Enter identification number: ");
scanf("%d",&n);
fprintf(fp,"%d\t",num);
printf("Enter Grade: ");
scanf("%c",&a);
fprintf(fp,"%c\n",a);
}
fclose(fp);
return 0;
}
12-5:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp1, *fp2, *fresult;
f1 = fopen("grade.txt", "r");
f2 = fopen("letter.txt", "r");
if(f1 == NULL || f2 == NULL)
{
perror("error..!!");
exit(0);
}
fresult = fopen("result.txt", "w");
if(fresult == NULL)
{
perror("error..!! ");
exit(0);
}
while((c=fgetc(f1)) ==fgetc(f2) && c!=EOF )
fputc(c,fresult);
fclose(f1);
fclose(f2);
fclose(fresult);
return 0;
}
Write c program. Do part 4 and 5 CH-12 TEXT FILES SE 12-3 Create a text file named grade.txt that you type yourself by your Each record in grade.txt should have the following format: by Columns...
Write a c program CH-12 TEXT FILES EXERCISE 12-12 Write a program to read two files of the same length, and determine if they are equal. For example: if one of the file has the content 123 abc 45 bye! and the other has 123 abc 55 bye! then these files are not equal CH-12 TEXT FILES EXERCISE 12-12 Write a program to read two files of the same length, and determine if they are equal. For example: if one...
Write a c program. CH-12 has arbitrary number of lines and one num. txt EXERCISE 12-11 te a program to create a new file numnew. txt that will he ine. A text file will have number in reverse order of the file num.txt For example: M the num.txt file is 7632 582 13101 then the numnew. txt file will be 1367 285 10131 CH-12 has arbitrary number of lines and one num. txt EXERCISE 12-11 te a program to create...