Question: #include struct Invoice { char customerName [ 5 0 ] ; int customerId; char dateOfPurchase [ 1 0 ] ; float amountOfPurchase; int billNumber; }
#include
struct Invoice
char customerName;
int customerId;
char dateOfPurchase;
float amountOfPurchase;
int billNumber;
;
int main
FILE file fopeninvoicetxtrb; Open in binary read mode
struct Invoice bill;
int billNumberToSearch;
if file NULL
perrorError opening the file";
return ;
printfEnter bill number to search: ;
scanfd &billNumberToSearch;
whilefread&bill, sizeofstruct Invoice file
ifbillbillNumber billNumberToSearch
printfCustomer Name: s
bill.customerName;
printfCustomer ID: d
bill.customerId;
printfDate of Purchase: s
bill.dateOfPurchase;
printfAmount of Purchase: f
bill.amountOfPurchase;
printfBill Number: d
bill.billNumber;
fclosefile;
return ;
printfNo bill found with the given number.
;
fclosefile;
return ;
what is the output for this
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
