#include<stdio.h>
#include<string.h>
struct Car{
// Provide structure definiton for Car here}
char name[20];
float price;
};
void UpdateA (struct Car data[]);
void DisplayA (struct Car data[]);
main(){
struct Car Proton[3];
//Call function UpdateA and DisplayA here
UpdateA(Proton);
DisplayA(Proton);
return 0;
}
void UpdateA(struct Car data[]){
//update table A data here
strcpy(data[0].name,"Saga");
data[0].price=42000;
strcpy(data[1].name,"Waja");
data[1].price=60000;
strcpy(data[2].name,"Persona");
data[2].price=55000;
}
void DisplayA(struct Car data[]){
//Display the table A on screen
int i;
for(i=0;i<3;i++)
printf("Model=%s price=%.f\n",data[i].name,data[i].price);
}
Comments