Computer Science, asked by ayeshaarora1401, 7 months ago

program in c for grocery bill​

Answers

Answered by sameerronaldo12763
6

Answer:

C Program to Display the Inventory of Items in a Store, C program to display the inventory of items in a store / shop * The inventory maintains struct date mfg; }; struct details item[50]; int n, i; printf("Enter number of items:"); scanf("%d", We are reading the number of variables using 'n' variable.

Answered by parthu2011
8

Answer:

c program calculate bill for grocery shop

c program calculate bill for grocery shop,c program calculate bill for grocery shop without using array

#include"stdio.h"

#include"conio.h"

void main()

{       float bill,rate[10];

   int qty[10],i,bid,n;

   char date[15],item[10][20],cname[20],addr[80],phone[11];

   clrscr();

   printf("\nEnter the Bill id=");

   scanf("%d",&bid);

   fflush(stdin);

   printf("\nEnter the Date=");

   gets(date);

   printf("\nEnter the name of Customer=");

   gets(cname);

   printf("\nEnter the Address of customer=");

   gets(addr);

   printf("\nEnter the Phone number of customer=");

   gets(phone);

   printf("\n\nHow many purchase items=");

   scanf("%d",&n);

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

   {

       printf("\n\nEnter the %d item name=",i+1);

       fflush(stdin);

       gets(item[i]);

       printf("\nEnter the rate of %s item=",item[i]);

       scanf("%f",&rate[i]);

       printf("\nEnter the quantity of %s item=",item[i]);

       scanf("%d",&qty[i]);

       bill=bill+(rate[i]*qty[i]);

   }

   printf("\n\n************ Wel - Come ******************");

   printf("\n\nBill id is= %d",bid);

   printf("\n\nDate= %s",date);

   printf("\n\nCustomer name= %s",cname);

   printf("\n\nAddress= %s",addr);

   printf("\n\nPhone number=%s",phone);

   printf("\n\n\nItem name\tRate\tQty\tAmount");

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

   {

   printf("\n\n%s\t\t%.2f\t%d\t%.2f",item[i],rate[i],qty[i],rate[i]*qty[i]);

   }

   printf("\n\n\t\t\tTotal=  %.2f",bill);

   printf("\n\n************** Thank you ***********************");

   getch();

}

 

c program calculate bill for grocery shop,c program calculate bill for grocery shop without using array

Explanation:

if you are pleased with answer in turn

please subscribe my youtube chanel(Ramakrishna Nallangari youtube channel) for my effort

search for  

Ramakrishna Nallangari in search box

of youtube

Ramakrishna Nallangari in search box

Similar questions