hi guys,
iam a beginner in c and i have got a project to make a program to keep the track of stock and cash of a shop i had done my work but i want to add purchase and iam unable to keep the work in history as a software works in shops so plz help me how i can make it i have to submit the program by tommorrow.
here is my program:
#include<stdio.h>
#include<conio.h>
void main()
{
int stock=0,quan,ch;
float mrp,cash=0;
clrscr();
while(1) {
printf("\n1)SALE\n:");
printf("\n2)TOTAL STOCK\n:");
printf("\n3)TOTAL CASH IN HAND\n:");
printf("\n5)EXIT\n:");
printf("ENTER YOUR CHOICE:");
scanf("%d",&ch);
if(ch==1) {
printf("\nENTER THE QUANTITY:");
scanf("%d",&quan);
printf("\nENTER THE TOTAL STOCK:");
scanf("%d",&stock);
stock=stock-quan;
printf("\nENTER PRICE:");
scanf("%f",&mrp);
cash=mrp*quan;
printf("\nTOTAL AMOUNT IS :%f",cash);
} else if(ch==2) {
printf("\nTHE TOTAL STOCK IS:%d",stock);
} else if(ch==3) {
printf("\nTHE TOTAL CASH IN HAND IS:%f",cash);
} else if(ch==5) {
exit(0);
}
}
getch();
}