Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Advertisement
Add Comment
Please, Sign In to add comment