You are on page 1of 2

1. // Program to print all master record on printer. #include<stdio.h> #include<iostream.h> #include<conio.h> #include<fstream.

h> int main( ) {struct emp { int empno; char name[25]; char fname[25]; char addl[25]; char designation[25]; float basic; float da; float hra; 1; clrscr( ); struct emp e; char cc; fstream fp1; fstream fp; fp.open ("PRN", ios::out ); fp1.open ("master", ios::in , ios::binary ); while(fp1) fp 1 .read((char*)&e , sizeof(e));

fp<<"The Employee No1 :- "; fp<<int(e.empno); fp<<"The Employee Name. :- "; fp<<e.name; fp<<"The Employee Father's Name. :- "; fp<<e.fname; fp<<"The Employee Address. :- ; fp<<e.addl; fp<<"The Employee Designation. :-; fp<<e.designation; fp<<"The Employee Basic. :- "; fp<<float(e.basic); fp<<"The Employee D.A. :-; fp<<float(e.da); fp<<"The Employee H.R.A;-; fp<<float(e.hra); } fcloseall ( ); return (1); }

You might also like