#include #include #include #include #include void ascending (double *tptr, int days); void descending (double *tptr, int days); void AVE (double *tptr, int days); void Display (double *tptr, int days); void MINMAX (double *tptr, int days, double mini, double max); int main() { int menu, days; register int i; double *tptr; double mini, max; clrscr(); printf("Enter the number of days : "); scanf("%d", &days); tptr=(double *)malloc(days * sizeof(double)); for (i=0;i>> "); scanf("%d", &menu); if (menu==1) { descending (tptr, days); printf("\n**** Temeratures are ****\n"); Display (tptr, days); } if (menu==2) { ascending (tptr, days); printf("\n**** Temeratures are ****\n"); Display (tptr, days); } if (menu==3) { AVE (tptr, days); } if (menu==4) { printf("\nEnter the minimum temperature : "); scanf("%ld", &mini); printf("\nEnter the maximum temperature : "); scanf("%ld", &max); MINMAX (tptr, days, mini, max); } printf("\n\nHit any key back to menu."); getch(); clrscr(); }while(menu!=5); printf("\n\nHit any key back to menu."); getch(); fflush(stdin); free(tptr); return 0; } void ascending (double *tptr, int days) { int i, j; double temp; for (i=0;i tptr[j]) { temp = tptr[i]; tptr[i] = tptr[j]; tptr[j] = temp; } } } } void descending (double *tptr, int days) { int i, j; double temp; for (i=0;i max ) { temp = mini; mini = max; max = temp; } for(i=0;i=mini&&tptr[i]<=max) count++; } printf("\nThere are %d days within the range.", count); }