Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- struct article{
- char title[60];
- char cat[50];
- int num;
- float price;
- };
- struct article art = {"Yumyum","Food",20,14.5};//Mama
- struct article art2;
- struct article art3[5] = { {"Mama","",0,0} ,
- {"","",0,0},{"","",0,0},
- {"","",0,0},{"","",3,0}};
- struct article output(struct article art[]);
- int main(){
- printf("enter title (art2):");
- scanf("%s",art2.title);
- printf("enter num (art2):");
- scanf("%d",&art2.num);
- printf("%s %s %d %.1f\n",art2.title,art2.cat,art2.num,art2.price);
- int i=0;
- while(i<5){
- printf("[%d] : %s %s %d %.1f\n",i+1,art3[i].title,art3[i].cat,art3[i].num,art3[i].price);
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement