Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4. struct shop
  5. {
  6. char name[30];
  7. int qty;
  8. float price;
  9. };
  10. struct shop simprint(shop s);
  11. void main()
  12. {
  13. struct shop item;
  14. printf("enter name=");
  15. scanf("%s",item.name);
  16. fflush(stdin);
  17. printf("enter qty=");
  18. scanf("%d",&item.qty);
  19. printf("enter price=");
  20. scanf("%f",&item.price);
  21. item=simprint(item);
  22. printf("name=%s\n",item.name);
  23. printf("qty=%d\n",item.qty);
  24. printf("price=%f",item.price);
  25. system("pause");
  26. }
  27. struct shop simprint(shop s)
  28. {
  29. s.qty=s.qty+10;
  30. s.price=s.price+10;
  31. return s;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement