answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{ FILE *fp;

char nm[50];

int a,b,n,i;

printf("\nInput file name:");

gets(nm);

printf("\nEnter no. of employees:");

scanf("%d",&n);

fp=fopen(nm,"w");

printf("Input Invendory Data:\n");

printf("Enter name age basic salary\n");

for(i=1;i<=n;i++)

{ scanf("%s %d %d",nm,&a,&b);

fprintf(fp,"%s %d %d",nm,&a,&b);

}

fclose(fp);

getch();

}

If the ans helps you,plz increase the trust point.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program in c to read the name age and basic salary of n employee and write these data to a file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

The distance between two cities in km is input through the keyboard write a program to convert and print this distance in meters feet inches and centimeters?

mesh's basic salary is input through the keyboard. his dearness allowance is 40% of basic salarying , and house rent allowance is 20% of basic salaried. write a program to calculate his gross salary


What is the percentage of employer's contribution to provident fund on employee's basic?

It is 12% of your Basic Salary


What basis can an employer deduct his share of pf contribution from employees salary?

On the basis of the Basic Salary component that is part of the salary. The amount contributed is 12% of the basic salary from employee as well as an equal contribution by the employer


Can pf contribution of employee be reduced?

No. It is set at a minimum of 12% of the employees basic salary


What is the provident fund amount that employers should contribute?

12% of the basic salary paid out to the employee


Second sem cobol question paper previous year?

Each question carries 10 marks. Explain the environment Division with example. Explain the Data Division with an example. Explain the various types of Move statements. Write a COBOL program to find a given integer is odd or even. An input file consists of the following Employee name, Employee number, Basic pay. Write a COBOL program to create an Indexed file which consists of Employee-name, Employee-number, Basic-pay and DA (DA = 25% of Basic-pay) Assume that an organisation has 20 departments. Each department has 5 stores. You are provided with total monthly sales of each stores for the month December 2000. Write a COBOL program to read the data, to write the sales report department wise and also write the total sales of the organisation.


What is the percentages of employee provident fund?

Contribution is 12% of the basic salary and the current interest rate is 8.6%


Who is responsible for PF?

An employee whose drawing wage or basic salary has upto rs 6500/- responsible to pay pf contribution 12 % from employer &amp; employee respectively.


How do you write a standard basic program?

That really depends on what sort of program you are trying to build, what do you want the program to do?


What are the basic concepts of RDBMS?

RDBMS is the acronym for Relational DataBase management indicating that the datastores, the tables are related to each other. Take the case of an employee table - the employee details like his employee number, name and address are stored there. Take another table, salary where the employee's salary is stored. The link or the relation between these two is the employee number that is used to uniquely identify the employee.


How do you write BASIC program to accept variables?

dim a input a


How do you deduct PF contribution for piece rate employee?

You need to fix a certain amount as basic salary if you want to deduct PF. set a minimum number as basic salary and calculate PF on it. The remaining amount based on piece rate can be added a different component in the persons salary