Commit 904cba83 by grtrol

tund3.2.c

parent 20fb48e6
#include <stdio.h>
int main(void)
{
int S = 0;
int i = 0;
int K = 0, N;
do
{
printf("sisesta rea pikkus: \n");
scanf("%d",&N);
}while (N <= 0);
int A[N];
do
{
printf("sisesta %d : ", i);
scanf("%d",&K);
A[i] = K;
i++;
}
while (i < N);
i = 0;
do
{
S = S + A[i];
i++;
}
while (A[i] > 0 && i < N);
printf("tulemus : %d \n", S);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment