Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jürgen Hein
/
iax0583
This project
Loading...
Sign in
Toggle navigation
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
e89d5a2d
authored
Oct 18, 2024
by
Jürgen Hein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
katsetus int kontrolliga Kodutoo2MassiividLiitmine.c
parent
4b993b2e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
Kodutöö 2/Kodutoo2MassiividLiitmine.c
Kodutöö 2/Kodutoo2MassiividLiitmine.c
View file @
e89d5a2d
/* Ko
dutöö 2. Variant 4.
/* Ko
dutöö 2. Variant 4.
...
...
@@ -39,15 +39,27 @@ int main(void)
int
Sisestus
(
char
teade
[])
{
int
arv
;
int
i
;
int
Kontroll
;
int
S
[]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
};
do
{
printf
(
"%s
\n
"
,
teade
);
scanf
(
"%d"
,
&
arv
);
if
(
arv
<=
1
||
arv
>=
10
)
Kontroll
=
0
;
for
(
i
=
0
;
i
<
max
;
i
++
)
{
if
(
arv
==
S
[
i
])
//Kontroll, kas väärtus on täisarv vahemikus 1...10.
{
Kontroll
=
1
;
//Sisestus sobib piirkonda
}
}
if
(
Kontroll
==
0
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
arv
<=
1
||
arv
>=
10
);
}
while
(
Kontroll
==
0
);
return
arv
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment