วันศุกร์ที่ 26 มิถุนายน พ.ศ. 2552

DTS02-23/06/2009

#include<stdio.h>
#include<string.h>
int main(void){
struct Mycar{
char Brand[6];
char Model[5];
char Color[6];
char Type[10];
char Production[8];
char Address[9];
int Price;
float Performance;
}car;
struct car;
strcpy(car.Brand,"Honda");
strcpy(car.Model,"City");
strcpy(car.Color,"Black");
strcpy(car.Type,"Automobile");
strcpy(car.Production,"Thailand");
strcpy(car.Address,"HNontaburi");
car.Price=560;
car.Performance=1.5;
printf("Brand:%s\n\n",car.Brand);
printf("Model:%s\n\n",car.Model);
printf("Color:%s\n\n",car.Color);
printf("Type:%s\n\n",car.Type);
printf("Production:%s\n\n",car.Production);
printf("Address:%s\n\n",car.Address);
printf("Price:%d\n\n",car.Price);
printf("Performance:%f\n\n",car.Performance);
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น