ACP_U1p3.c

#include<stdio.h> #include<conio.h> struct item { int item_code; char item_name[20]; int price; }; void update_price(struct item a[5]); void main() { int i; struct item a[5]; clrscr(); for(i=1;i<5;i++) { printf("enter the item code,name,price:"); scanf("%d %s %d",&a[i].item_code,&a[i].item_name,&a[i].price); } update_price(a); for(i=1;i<5;i++) { printf("code=%d\n",a[i].item_code); printf("name=%s\n",a[i].item_name); printf("price=%d\n",a[i].price); } getch(); } void update_price(struct item a[5]) { int i; for(i=1;i<5;i++) { a[i].price=a[i].price+((a[i].price*10)/100); } }

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.