Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- int qualifier, count=0;
- long int inp_number, min, max;
- float sum = 0;
- float average;
- qualifier = scanf("%ld", &inp_number);
- if (qualifier == 1){
- for (min = max = inp_number; qualifier == 1; count ++){
- if (inp_number > max){
- max = inp_number;
- }
- else if (inp_number < min){
- min = inp_number;
- }
- sum += inp_number;
- qualifier = scanf("%ld", &inp_number);
- }
- average = sum / count;
- printf("average is ");
- printf("%f\n", average);
- printf("max is ");
- printf("%ld\n", max);
- printf("min is ");
- printf("%ld\n", min);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment