Make a program to save data of students ,employ
code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define NUM 3
int main()
{
FILE *fptr;
int i,j;
int age[5];
char name[5][20];
char group[5][20];
fptr=fopen("std.txt","a");
for(int i=0;i<NUM;i++)
{
printf("name: ");
scanf("%s",&name[i]);
printf("age: ");
scanf("%d",&age[i]);
printf("phone number:");
scanf("%s",&group[i]);
}
for(int i=0;i<NUM;i++)
{
fprintf(fptr,"Name:%s\n",name[i]);
fprintf(fptr,"age:%d\n",age[i]);
fprintf(fptr,"phone number:%s\n",group[i]);
}
fclose(fptr);
getche();
}