donmike25 icon

gogo

donmike25 | PRO | 11/06/13 06:45:43 AM UTC | 0 ⭐ | 195 👁️ | Never ⏰ | []
text |

630 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
 struct Stock{char grade;
	     float price;
};
void update_Stock(struct Stock*point, char grade, float price);
void Display(struct Stock data);
main() {
 struct Stock shell={'C',28.10},esso={'D',18.50};
 update_Stock(&shell,'A',128.50);
update_Stock(&esso,'B',55.80);
  printf ("For shell:\n");
display (shell);
printf ("\nFor esso:\n");
display (esso);
return 0;
}
void update_Stock(struct Stock*point, char grade, float price){
point->grade=grade;
point->price=price;
}
void Display(struct Stock data){
printf("The grade is %c\n",data.grade);
printf("The price is %.2f\n",data.price);
 }

Comments