Monday, February 23, 2009

find minimum and maximun from the array

structure in c profram 2

#include main(void) { struct computer {float cost; char name[15]; int b_date; char city[10]; }nc[3]; int i; for(i=0;i<2;i++) { printf("NAME:"); gets(nc[i].name); printf("b_date::"); scanf("%d",&nc[i].b_date); flushall(); printf("CITY:"); gets(nc[i].city); } for(i=0;i<=5;i++) { printf("\n NAME: %s",nc[i].name); printf("\n CITY: %s",nc[i].city); printf("\n B_DATE:YEAR %d ",nc[i].b_date); getch(); } return 0; }