donmike25 icon

tut5(2)

donmike25 | PRO | 07/21/13 03:30:27 PM UTC | 0 ⭐ | 207 👁️ | Never ⏰ | []
C |

440 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
 
int main()
 
{
float readings[9]={2.5,3.5,0.5,4.6,3.2,0.8,1.2,4.8,3.8};
int i;
int low=0, medium=0, high=0;
 
for(i=0;i<=8;i++)
{
    if(readings[i]>4.0) high++;
        else if(readings[i]>2.0) medium++;
        else low++;}
 
printf("There are %d places recorded low rainfall\n",low);
printf("There are %d places recorded medium rainfall\n",medium);
printf("There are %d places recorded high rainfall\n",high);
 
return 0;
}

Comments