Commit dff17dd7 by karlki

praktikum 3

parent 97fe417b
Showing with 41 additions and 0 deletions
#include <stdio.h>
int main(void)
{
int S = 0, i = 0, input = 0, N;
do
{
printf("Sisesta rea pikkus: \n");
scanf("%d", &N);
} while ( N <= 0);
int A[N];
do
{
printf("Sisesta %d : ", i);
scanf("%d", &input);
A[i] = input;
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