Professional Documents
Culture Documents
/*Group from 45 to 54 */
#include<stdio.h>
#include<conio.h>
Int main()
Struct d{
Char nm[50];
Int pr;
};
Int i,j,choice,np,qt,sum=0,tot;
Char ch;
Struct d arr_d[43]={
/*dairy 0-6*/
{“toned milk(100ml)”,20},
{“lamb(1 Kg)”,399},
{“fish(250 gm)”,223},
{“table-egg(1 unit)”,9},
{“regular-egg(1 unit)”,5},
{“Cardio_egg(1 unit)”,12},
{“Apple(1 Kg)”,151},
{“Pears(1Kg)”,169},
{“Bananas(1 doz)”,39},
{“Lychee(250 gm)”,75},
{“Avacado(250 gm)”,65},
{“Pineapple(1 piece)”,35},
{“Kivifruit(1 piece)”,12},
{“Strawberry(250 gm)”,150},
{“Alphonso(500gm)”,60},
{“grapes(500gm)”,30},
{“Almond(50gm-packet)”,45},
{“Raisins(50gm-packet)”,10},
{“Cashew(50gm-packet)”,48},
{“Walnut(50gm-packet)”,55},
{“pecan nuts(50 gm-packet)”,99},
{“Dates(100gm-packet)”,34},
{“Figs(100gm-packet)”,179},
/*Snacks 30-35*/
{“Mad angles(40gm-pack)”,10},
{“Haldiram Bhujia(60gm-pack)”,10},
{“Instant Bhel(55gm-pack)”,10},
{“Moong Dal(30gm-pack)”,10},
{“coca cola(300ml-can)”,33},
{“sprite (300ml-can)”,39},
{“Toothbrush”,40},
{“Toothpaste(100gm)”,30},
{“Everyouth facewash(50gm)”,39},
{“Listerine(250 ml)”,125},
{“Parachute Oil(100ml)”,37},
Begin:
Printf(“3.To exit\n”);
Scanf(“%d”,&choice);
/*To Watch products available*/
If(choice==1)
For(i=0;i<=42;i++)
Printf(“%d\t%s\t%d\n”
,i,arr_d[i].nm,arr_d[i].pr);
Printf(“b.To go back”);
Scanf(“\n%c”,&ch);
If(ch==’b’)
{ goto begin;}
Else if(choice==2)
Scanf(“%d”,&np);
For(j=1;j<=np;j++)
Scanf(“\n%d”,&i);
Printf(“\t%s\t”,arr_d[i].nm);
Scanf(“\t%d”,&qt);
Sum+=(arr_d[i].pr)*qt;
Tot=sum;
Printf(“\n\n”); printf(“\n**________BILL________**”);
Printf(“\n Total=%d Rs”,sum);
If(sum>=1000)
Sum+sum*(0.05-0.15));
Else{
Printf(“\nGrand total=%f”,
Sum+sum*0.15);
Else if(choice==3)
{goto end;}
End:
// getch();for turbo c
Return 0;