Untitled
unknown
plain_text
2 years ago
524 B
8
Indexable
#include <stdio.h>
#include <stdlib.h>
void main()
{
FILE *fptr;
char name[30];
int roll;
char address[50];
float marks;
fptr=fopen("C:\\student.txt","w");
if(fptr==NULL) {
printf("Unable to create or open the file.\n");
exit(0);
}
printf("Enter name of the student: \t");
gets(name);
printf("Enter roll of %s: \t",name);
scanf("%d",&roll);
printf("Enter address of %s: \t",name);
gets(address);
printf("Enter marks of %s: \t",name);
scanf("%f",&marks);
}
Editor is loading...
Leave a Comment