C program for the inventory store/shop

#include <stdio.h> #include <conio.h> void main() {     struct date { int...


#include <stdio.h>
#include <conio.h>

void main()
{    
struct date
{
int day;
int month;
int year;
};

struct details
{
char name[20];
int price;
int code;
int qty;
struct date mfg;
};

struct details item[50];
int n,i;

clrscr();

printf("Enter number of items:");
scanf("%d",&n);
fflush(stdin);

for(i=0;i<n;i++)
{
fflush(stdin);
printf("Item name:");
scanf("%[^\n]",item[i].name);

fflush(stdin);
printf("Item code:");
scanf("%d",&item[i].code);
fflush(stdin);

printf("Quantity:");
scanf("%d",&item[i].qty);
fflush(stdin);

printf("price:");
scanf("%d",&item[i].price);
fflush(stdin);

printf("Manufacturing date(dd-mm-yyyy):");
scanf("%d-%d-%d",&item[i].mfg.day,&item[i].mfg.month,&item[i].mfg.year);
}
printf("             *****  INVENTORY *****\n");
printf("------------------------------------------------------------------\n");
printf("S.N.|    NAME           |   CODE   |  QUANTITY |  PRICE  |MFG.DATE\n");
printf("------------------------------------------------------------------\n");
for(i=0;i<n;i++)
printf("%d     %-15s        %-d          %-5d     %-5d     %d/%d/%d\n",i+1,item[i].name,item[i].code,item[i].qty,item[i].price,
     item[i].mfg.day,item[i].mfg.month,item[i].mfg.year);
printf("------------------------------------------------------------------\n");
getch();
}

/*------------------------------------------------------
Enter number of items:5
Item name:Tea Powder
Item code:123
Quantity:23
price:40
Manufacturing date(dd-mm-yyyy):12-03-2007
Item name:Milk Powder
Item code:345
Quantity:20
price:80
Manufacturing date(dd-mm-yyyy):30-03-2007
Item name:Soap Powder
Item code:510
Quantity:10
price:30
Manufacturing date(dd-mm-yyyy):01-04-2007
Item name:Washing Soap
Item code:890
Quantity:25
price:12
Manufacturing date(dd-mm-yyyy):10-03-2007
Item name:Shampo
Item code:777
Quantity:8
price:50
Manufacturing date(dd-mm-yyyy):17-05-2007
*****  INVENTORY *****
------------------------------------------------------------------------
S.N.|    NAME           |   CODE   |  QUANTITY |  PRICE  |MFG.DATE
------------------------------------------------------------------------
1     Tea Powder             123          23        40        12/3/2007
2     Milk Powder            345          20        80        30/3/2007
3     Soap Powder            510          10        30        1/4/2007
4     Washing Soap           890          25        12        10/3/2007
5     Shampo                 777          8         50        17/5/2007
------------------------------------------------------------------------

--------------------------------------------------------------------*/

Related

C TUTORIAL 8734144777650521024

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

Search Here

Popular query

Ads By Google

Get free Update

Enter your email address:

E-mail verification is must for complete subscription

Delivered by FeedBurner

RecentRecommendedComments

Recent

OnePlus Pad 2: A Comprehensive Review

In the rapidly evolving landscape of tablets, OnePlus has made a significant splash with its latest offering, the OnePlus Pad 2. This tablet is packed with impressive specs and features, positioning i...

DLSA Loan Settlement Notice | How to settle | One time Settlement agreement | Advocate guideline

 If your client has received a notice for loan settlement from the District Legal Services Authority (DLSA), this means the matter is being referred for amicable settlement through Lok Adalat or ...

Unfair Means in Public Examinations: A Comprehensive Overview of the Public Examinations (Prevention of Unfair Means) Act, 2024

Public examinations hold a crucial position in shaping the academic and professional trajectories of individuals. Given their importance, the integrity of these examinations is paramount. However, unf...

Difference between section 138 and section 141 of negotiable Instrument Act 1881 with example

Difference between section 138 and 141 of negotiable act in india Section 138 and Section 141 of the Negotiable Instruments Act, 1881, deal with the legal liabilities of individuals and entities in ca...

Comments

Urvi Blog:

Nice blog you are posting thanks for your post : BS System Solutions

Make Cash:

UPLOAD SAMPLE FILLED UP FORM OF NOTE SHEET.

Anonymous:

Best blog I received valuable thing it give me full information. thank for making this kind of blog.it help me a lot. for more this kind of information you can check my blog also the International Co...

mithu dowari:

please provide NOC from

Circle AFS on Google Plus!

Follow AFS Google+ page
 

Side Ads

DMCA protected
Information, images and the content on this blog is Copyright ©AFS2011-2018. Please do not copy Any content for commercial purpose else we have to take a legal action. Thanks !!

Total Pageviews

Recent

free counters
 

Connect Us

Speech by ReadSpeaker

item