mdnurnobihosen

datastructure10

Jun 21st, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.96 KB | None | 0 0
  1. ///Home Work 10 @Nurnobi shanto
  2. #include<stdio.h>
  3. #include<string.h>
  4. typedef struct Product
  5.     {
  6.         char name[30];
  7.         int code;
  8.         float price;
  9.     }p;
  10. int main()
  11. {
  12.     p shampoo,Tshirt;
  13.     printf("Enter shampoo product name:");
  14.     scanf("%s",&shampoo.name);
  15.     printf("Enter product code:");
  16.     scanf("%d",&shampoo.code);
  17.     printf("Enter shampoo price:");
  18.     scanf("%f",&shampoo.price);
  19.  
  20.     printf("\nEnter T-Shirt product name:");
  21.     scanf("%s",&Tshirt.name);
  22.     printf("Enter product code:");
  23.     scanf("%d",&shampoo.code);
  24.     printf("Enter T-shirt price:");
  25.     scanf("%f",&shampoo.price);
  26.  
  27.     printf("\nShampoo product name:%s\n",shampoo.name);
  28.     printf("product code: %d\n",shampoo.code);
  29.     printf("shampoo price: %f\n",shampoo.price);
  30.  
  31.     printf("\nT-Shirt product name:%s\n",Tshirt.name);
  32.     printf("product code: %d\n",shampoo.code);
  33.     printf("Enter T-shirt price: %f\n",shampoo.price);
  34.  
  35.  
  36.  
  37.     return 0;
  38. }
Add Comment
Please, Sign In to add comment