0% found this document useful (0 votes)
24 views

Prahadi C Project With Output

The program simulates a store transaction, allowing a customer to purchase multiple items and prints a final receipt. It tracks item names, quantities, prices and totals for each purchase, applies GST, discount and provides a final billed amount.

Uploaded by

Prahadeeswari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Prahadi C Project With Output

The program simulates a store transaction, allowing a customer to purchase multiple items and prints a final receipt. It tracks item names, quantities, prices and totals for each purchase, applies GST, discount and provides a final billed amount.

Uploaded by

Prahadeeswari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

PROGRAM

#include<stdio.h>
int main () {
printf (" ******Welcome to Sangili Bungili Stores******\n");
printf("Customer: I want to buy a mouse and a keyboard.\n\n");
char *laptop;
int numbers1;
int price1;
int total1=numbers1*price1;
char *system;
int numbers2;
int price2;
int total2=numbers2*price2;
char *mouse;
int numbers3;
int price3;
int total3=numbers3*price3;
char *keyboard;
int numbers4;
int price4;
int total4=numbers4*price4;
char *camera;
int numbers5;
int price5;
int total5=numbers5*price5;
char *CPU;
int numbers6;
int price6;
int total6=numbers6*price6;
char *printer;
int numbers7;
int price7;
int total7=numbers7*price7;
char *speaker;
int numbers8;
int price8;
int total8=numbers8*price8;
char *headset;
int numbers9;
int price9;
int total9=numbers9*price9;
if(laptop!=1) {
printf("i don't want laptop\n");
printf("total price of laptop is %d\n\n",total1=0);
}
else {
printf("\nenter the name of the product a: ");
scanf("%s",&laptop);
printf("enter the quantity: ");
scanf("%d",&numbers1);
printf("enter the price of single price: ");
scanf("%d",&price1);
printf("total price of laptop is %d\n\n",total1=numbers1*price1);
}
if(system!=1) {
printf("i don't want system\n");
printf("total price of system is %d\n\n",total2=0);
}
else {
printf("\nenter the name of the product b: ");
scanf("%s",&system);
printf("enter the quantity: ");
scanf("%d",&numbers2);
printf("enter the price of single price: ");
scanf("%d",&price2);
printf("total price of system is %d\n\n",total2=numbers2*price2);
}
if(mouse==1) {
printf("i don't want mouse\n");
printf("total price of mouse is %d\n\n",total3=0);
}
else {
printf("\nenter the name of the product c: ");
scanf("%s",&mouse);
printf("enter the quantity: ");
scanf("%d",&numbers3);
printf("enter the price of single price: ");
scanf("%d",&price3);
printf("total price of mouse is %d\n\n",total3=numbers3*price3);
}
if(keyboard==1) {
printf("i don't want keyboard\n");
printf("total price of keyboard is %d\n\n",total4=0);
}
else {
printf("\nenter the name of the product d: ");
scanf("%s",&keyboard);
printf("enter the quantity: ");
scanf("%d",&numbers4);
printf("enter the price of single price: ");
scanf("%d",&price4);
printf("total price of keyboard is %d\n\n",total4=numbers4*price4);
}
if(camera!=1) {
printf("i don't want camera\n");
printf("total price of camera is %d\n\n",total5=0);
}
else {
printf("\nenter the name of the product e: ");
scanf("%s",&camera);
printf("enter the quantity: ");
scanf("%d",&numbers5);
printf("enter the price of single price: ");
scanf("%d",&price5);
printf("total price of camera is %d\n\n",total5=numbers5*price5);
}
if(CPU!=1) {
printf("i don't want CPU\n");
printf("total price of CPU is %d\n\n",total6=0);
}
else {
printf("\nenter the name of the product f: ");
scanf("%s",&CPU);
printf("enter the quantity: ");
scanf("%d",&numbers6);
printf("enter the price of single price: ");
scanf("%d",&price6);
printf("total price of CPU is %d\n\n",total6=numbers6*price6);
}
if(printer!=1) {
printf("i don't want printer\n");
printf("total price of printer is %d\n\n",total7=0);
}
else {
printf("\nenter the name of the product g: ");
scanf("%s",&printer);
printf("enter the quantity: ");
scanf("%d",&numbers7);
printf("enter the price of single price: ");
scanf("%d",&price7);
printf("total price of printer is %d\n\n",total7=numbers7*price7);
}
if(speaker!=1) {
printf("i don't want speaker\n");
printf("total price of speaker is %d\n\n",total8=0);
}
else {
printf("\nenter the name of the product h: ");
scanf("%s",&speaker);
printf("enter the quantity: ");
scanf("%d",&numbers8);
printf("enter the price of single price: ");
scanf("%d",&price8);
printf("total price of system is %d\n\n",total8=numbers8*price8);
}
if(headset!=1) {
printf("i don't want headset\n");
printf("total price of headset is %d\n\n",total9=0);
}
else {
printf("\nenter the name of the product i: ");
scanf("%s",&headset);
printf("enter the quantity: ");
scanf("%d",&numbers9);
printf("enter the price of single price: ");
scanf("%d",&price9);
printf("total price of headset is %d\n\n",total9=numbers9*price9);
}
int rate;
printf("your net amount is %d\n\n",rate=total1+total2+total3+total4+
total5+total6+total7+total8+ total9);
int x,y,z;
char u='/';
scanf("%d%d%d",&x,&y,&z);
printf("*****************************************\n");
printf ("***Welcome to Sangili Bungili Stores***\n");
printf("*****************************************\n\n");
printf("BILL DATE: %d%c%d%c%d\n",x,u,y,u,z);
char *name;
printf("ENTER THE NAME OF THE CUSTOMER: ");
scanf("%s",&name);
float CGST=0.09;
float SGST=0.09;
float GST;
printf("CGST:9%: %f\n",CGST=rate*CGST);
printf("SGST:9%: %f\n",SGST=rate*SGST);
printf("ADD: %f\n",GST=CGST+SGST);
float DISC=0.10;
float RED=DISC;
printf("DISCOUNT:10%: %f\n",RED=rate*DISC);
printf("LESS: %f\n",RED);
float billamount;
printf("BILL AMOUNT: %f\n\n",billamount=rate+GST-RED);
int rounded_off=billamount;
printf("ROUNDED OFF: %d\n\n",rounded_off);
printf("Do you want to pay through cash or card?\n");
int Cash=1;
int Card=0;
if(Card<Cash) {
printf("Cash\n");
}
else
{
printf("Card\n");
}
printf("Amount paid\n");
printf("++++++++++++++++++++++++++++++++++++++++\n");
printf(" Thank You!!!Visit Again!!!\n");
printf("++++++++++++++++++++++++++++++++++++++++\n");
return 0;
}

Output:
******Welcome to Sangili Bungili Stores******
Customer: I want to buy a mouse and a keyboard.

i don't want laptop


total price of laptop is 0

i don't want system


total price of system is 0

enter the name of the product c: MOUSE


enter the quantity: 5
enter the price of single price: 200
total price of mouse is 1000

enter the name of the product d: KEYBAORD


enter the quantity: 3
enter the price of single price: 500
total price of keyboard is 1500

i don't want camera


total price of camera is 0

i don't want CPU


total price of CPU is 0

i don't want printer


total price of printer is 0

i don't want speaker


total price of speaker is 0

i don't want headset


total price of headset is 0

your net amount is 2500

15
04
2023
*****************************************
***Welcome to Sangili Bungili Stores***
*****************************************

BILL DATE: 15/4/23


ENTER THE NAME OF THE CUSTOMER: PRAHADI
CGST:9%: 225.000015
SGST:9%: 225.000015
ADD: 450.000031
DISCOUNT:10%: 250.000000
LESS: 250.000000
BILL AMOUNT: 2700.000000

ROUNDED OFF: 2700

Do you want to pay through cash or card?


Cash
Amount paid
++++++++++++++++++++++++++++++++++++++++
Thank You!!!Visit Again!!!
++++++++++++++++++++++++++++++++++++++++

You might also like