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

Upload New File

parent 51c49883
Branches
No related merge requests found
#include <stdio.h>
int suma (int a[],int n){
int b,c;
c=0;
for(b=0;b<=n-1;b++){
c=c+a[b];
}
return c;
}
int main (){
int n,s;
printf("Podaj wielkosc tablicy\n");
scanf("%i",&n);
int a[n],i;
for(i=0;i<=n-1;i++){
printf("Podaj %i skladnik tablicy\n",i+1);
scanf("%i",&a[i]);
}
s=suma(a,n);
printf("Wszystkie skladniku po sumowaniu daja %.i\n",s);
}
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