#include #include /* This program defines a table of possidle rod diameters of a certain material X, and the corresponding maximum load that each rod can bear. The user can enter a diameter value and request a load value, or a load value to get a suitable diameter value. please do not remove this comment. source: C for Engineering, http://c4engineering.hypermart.net */ /* Table definition */ #define N 7 /*Number of entries in table*/ float diam[N]={10,12,15,18,20,22,25}, load[N]={420,540,658,860,1050,1230,1400}; void find_diam(void); void find_load(void); void main(void) { char ch; do{ clrscr(); printf("\nThis program fetches data from a maximum load versus\nrod diameter table.\nPlease select an option:\n"); printf("\n\t[1] Find the max load given a diameter.\n\t[2] Find a suitable diameter given a load.\n\t[3] Quit.\n"); printf("\nYour selection:"); ch=getch(); if(ch=='1') find_diam(); if(ch=='2') find_load(); }while(ch!='3'); return; } void find_diam(void) { int i; float l; printf("\n\nEnter the load required in Kg:"); scanf("%f",&l); for(i=0;i