Commit bd2c1f8c by grtrol

praktikum3

parent 904cba83
Showing with 42 additions and 0 deletions
#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