Skip to content
Snippets Groups Projects
Commit 5ff28225 authored by Jakub Walas's avatar Jakub Walas
Browse files

Upload New File

parent 7106f39f
No related merge requests found
#include <stdio.h>
int main(){
int i=0;
float x[10],X,s,max,min;
X=0;
while(i<10){
printf("Podaj %i pomiar\n",i+1);
scanf("%f",&x[i]);
i++;
}
for(i=0;i<10;i++){
X=X+x[i];
}
s=X/10;
printf("Srednia arytmetyczna pomiarow wynosi %.2f\n",s);
if(x[0]>x[1]){
max=x[0];
min=x[1];}
if(x[0]<x[1]){
max=x[1];
min=x[0];}
if(x[0]==x[1]){
max=x[1];
min=x[1];}
for(i=2;i<10;i++){
if(x[i]>max)
{max=x[i];}
if(x[i]<min)
{min=x[i];}
}
printf("Najmniejsza wartoscia jest %.2f\n",min);
printf("Najwieksza wartoscia jest %.2f\n",max);
return 0;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment