Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
muhega
/
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
61865025
authored
Sep 17, 2017
by
muhega
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
61f86a72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
lab2/main.c
lab2/main.c
0 → 100644
View file @
61865025
#include <stdio.h>
#include <stdlib.h>
int
main
()
{
int
x
,
i
=
1
;
printf
(
"what is the distance between moon and earth in KM?
\n
"
);
while
(
i
>
0
)
{
scanf
(
"%d"
,
&
x
);
if
(
x
==
0
)
{
i
=
0
;
printf
(
"someone needs to go to school!!
\n
"
);
}
else
if
(
x
==
384400
)
{
i
=
0
;
printf
(
"correct answer
\n
"
);
}
else
if
(
x
>=
365180
&&
x
<=
403620
)
{
i
=
0
;
printf
(
"close enough, YOU SHALL PASS!
\n
"
);
}
else
{
printf
(
"wrong answer! try again
\n
"
);
}
}
return
0
;
}
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