Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
master-embedded-systems
c-exercise-solutions public
Commits
5ec0a38d
Commit
5ec0a38d
authored
Nov 14, 2017
by
Dominik Widhalm
Browse files
Update example solution task 4.07 to fully comply with task specification
parent
87141ec9
Changes
1
Hide whitespace changes
Inline
Side-by-side
ch_4/task_07/main.c
View file @
5ec0a38d
...
...
@@ -55,15 +55,15 @@ int main (void) {
/* Read in the user's input */
scanf
(
"%lf"
,
&
cash
);
/* Check if input was valid */
if
(
cash
<
0
)
{
if
(
cash
<
0
.
1
)
{
/* Number has to be greater than 0 */
printf
(
"The entered deposit is less
than 0
!
\n
"
);
printf
(
"The entered deposit is
too
less!
\n
"
);
}
else
if
(
cash
>
MONEY_MAX
)
{
/* Number entered is too big */
printf
(
"The entered deposit is too big!
\n
"
);
}
/* Repeat when a invalid number was entered */
}
while
((
cash
<
0
)
||
(
cash
>
MONEY_MAX
));
}
while
((
cash
<
0
.
1
)
||
(
cash
>
MONEY_MAX
));
/*
* From this moment on we calculate with (int), because ...
...
...
Write
Preview
Supports
Markdown
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