#include <stdio.h>
struct item{
int code;
char name[20];
int price;
}item[5];
struct item price(struct item []);
void main()
{
int a;
clrscr();
for(a=0;a<5;a++)
{
printf("\nEnter Item %d details :\nCode : ",a+1);
flushall();
scanf("%d",&item[a].code);
printf("Name : ");
flushall();
gets(item[a].name);
printf("Price : Rs. ");
flushall();
scanf("%d",&item[a].price);
}
price(item);
for(a=0;a<5;a++)
{
printf("\nItem %d details :",a+1);
printf("\nCode : %d",item[a].code);
printf("\nName : %s",item[a].name);
printf("\nPrice : Rs.%d\n",item[a].price);
}
getch();
}
struct item price(struct item i[])
{
int a;
clrscr();
for(a=0;a<5;a++)
i[a].price=0.1*i[a].price+i[a].price;
printf("\n");
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.