Search Results

Search found 1 results on 1 pages for 'user2985811'.

Page 1/1 | 1 

  • having an issue about the output in c programming ..

    - by user2985811
    i'm having a problem on running the output after putting the input.. the output doesn't show after i put the variables and i don't know how to set the code .. so if you guys could help me with this, that would be grateful.. #include <stdio.h> #include <conio.h> int read_temps (float temps[]); int hot_days (int numOfTemp, float temps[]); int printf_temps (int numOfTemp, float temps[], int numOfHotDays); int main (void) { int index = 0; float tempVal; float temps[31]; int numOfTemp, numOfHotDays; do { printf ("Enter the temperature:"); scanf ("%f", &tempVal); if (tempVal!=-500.0) { temps[index] = tempVal; index++; } } while (tempVal != -500.0); return ; { int i; int count = 0; for (i = 0; i < numOfTemp; i++) { if (temps[i] > 32.0) count++; } return count; } { float sum = 0.0; int i; printf ("\nInput Temperatures:"); printf ("\n-------------------------"); for (i = 0;i < numOfTemp; i++) { printf ("\nDay %d : %.2fF", i+1, temps[i]); sum = sum + temps[i]; } printf ("\nNumber of Hot Days : %d", numOfHotDays); printf ("\nAverage Temperature: %.2f", sum/numOfTemp); } { clrscr (); numOfTemp = read_temps (temps); numOfHotDays = hot_days (numOfTemp, temps); clrscr (); printf_temps (numOfTemp, temps, numOfHotDays); getch (); } }

    Read the article

1