วันพฤหัสบดีที่ 25 มิถุนายน พ.ศ. 2552

การบ้าน

#include<stdio.h>
#include<string.h>
void main()
{
struct telephone
{
char brand[20];
char phone_colour[20];
char designed[20];
char mfd[10];
char serial_no[20];
float price;
unsigned long int hight;
unsigned int weight;
};
struct telephone center ;
strcpy(center.brand,"iphone");
strcpy(center.phone_colour,"white");
strcpy(center.designed,"california");
strcpy(center.mfd,"03march09");
strcpy(center.serial_no,"83751m76whb");
center.price=23000.50;
center.hight=11.03;
center.weight=5.5;
printf("*********Telephone*********\n\n");
printf(" Brand:%s\n\n",center.brand);
printf(" Phone_colour:%s\n\n",center.phone_colour);
printf(" Designed: %s\n\n",center.designed);
printf(" MFD : %s\n\n",center.mfd);
printf(" Serial_no : %s\n\n",center.serial_no);
printf(" Price:%d\n\n",center.price);
printf(" Hight : %d cm.\n\n",center.hight);
printf(" Weight : %d km.\n\n",center.weight);
}

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

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