Pages

E-mail us at prgms4starters@gmail.com for any queries or to share your programs. Please mention the program definition in the subject line.

In case you need help in finishing a program, do mention "incomplete pgm" in the subject line. Our team of experts will do their best to help you.

Click the link to follow this page for updates and reminders: FOLLOW THIS SITE

You can also visit our Facebook page by clicking HERE

**don't forget to participate in the polls at the bottom of the page

Monday, November 8, 2010

c program to generate a menu driven application to ship stocks to customers checking their credits and stock availability

#include<stdio.h>
main()
{
int credit,qty,stock=10000,bal,s,d,m,y,q,n=1;

printf("\nWELCOME\n");
printf("\n checking system date, please enter the date\n");
printf("\nday:");
scanf("%d",&d);
printf("\nmonth:");
scanf("%d",&m);
printf("\nyear:");
scanf("%d",&y);
printf("\n Enter your credit\n");
scanf("%d",&credit);
while(n==1)
{
printf("\n Enter you order qty\n");
scanf("%d",&qty);
s=qty*2000;
bal=credit-s;
if(credit<s)
printf("\n sorry your credit is low, your requirement can't be supplied\n");
else
if(credit>=s&&qty<stock)
{
printf("\n Thank you, your requirement of %d items has been supplied\n",qty);
printf("\n the total cost is Rs. %d",s);
printf("\n your current credit is Rs%d\t",bal);
}
else
if(credit>=s&&qty>stock)
{
printf("\n your credit is ok but your requirement is more than the stock present\n");
q=qty-stock;
printf("\n Thank you, your requirement of %d items has been supplied\n",qty);
printf("\n your current credit is Rs%d\t",bal);
printf("\n the remaining qty: %d items will be shipped after 1 month,on %d.%d.%d\n",q,d,m+1,y);
printf("\n sorry for the inconvenience\n");
}
printf("\n enter 1 to order more items and 0 to exit\n");
scanf("%d",&n);
}
}

No comments:

Post a Comment

We have noticed that 20% of our visitors are still using internet explorer. For a better and faster surfing experience we recommend that you switch to either Google Chrome or Mozilla Firefox. We cannot provide you the downloads but here are the links to sites where you can download them from

Google Chrome - click here to go to site

Mozilla Firefox - click here to go to site

Where are you from

Do you think this site was helpful

Should we put up more C or C++ programs