Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

haloog / IAX0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 49371674 authored 7 years ago by haloog's avatar haloog
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

kommentaar

parent 065461ee
Hide whitespace changes
Inline Side-by-side
Showing with 29 additions and 0 deletions
  • Praktikum2/Prog I 3.tud.c
Praktikum2/Prog I 3.tud.c 0 → 100644
View file @ 49371674
#include <stdio.h>
int main(){
int S=0;
int i=0;
int N=0;
while(N<=0){
printf("Sisesta rea pikkus N:");
scanf("%d", &N);
}
int A [N];
do{
scanf("%d", &A[i]);
printf("Sisestatud on %d.", A[i]);
i++;
}while(i<N);
for(i=0;i<=N;i++){
if(A[i]>0&&i<N){
S=S+A[i];
}
}
printf("Positiivsete elementide summa on %d", S);
return 0;
}
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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