<span role="button" tabindex="0" data-code="#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;
int salary;
char name[25];
int age,i;
clrscr();
fp=fopen("person.txt","w");
for(i=0;i
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;
int salary;
char name[25];
int age,i;
clrscr();
fp=fopen("person.txt","w");
for(i=0;i<5;i++)
{
printf("Enter your salary:\n");
scanf("%d",&salary);
printf("Enter your name:\n");
scanf("%s",name);
printf("Enter your age:\n");
scanf("%d",&age);
fprintf(fp,"%d\n%s\n%d\n",salary,name,age);
}
fclose(fp);
getch();
}