Skip to content
Snippets Groups Projects
Commit 87ac9d7b authored by Kacper Śmieżewski's avatar Kacper Śmieżewski
Browse files

Upload New File

parent e9be687c
Branches
No related merge requests found
#include <stdio.h>
#include <stdlib.h>
float tabsum(float tab[], int no){
float sum=0;
for(int i=0; i<no;i++){
sum+=tab[i];
}
return sum;
}
int main(){
float numbers[5];
printf("Podaj 5 elementow do tablicy: ");
for (int i=0; i<5;i++){
scanf("%f", &numbers[i]);
}
printf("Suma elementow to: %f\n",tabsum(numbers,5));
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