Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gürcan Güleç
/
iag0581
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fc27766d
authored
Oct 07, 2016
by
Gürcan Güleç
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some stuff on array.c
parent
08a41e85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
labs/lab3/array.c
labs/lab3/array.c
View file @
fc27766d
...
...
@@ -18,7 +18,7 @@ int main(void)
int
i
,
j
;
int
a
;
float
sum
=
0
;
float
average
=
0
;
float
median
;
int
sumOfOdd
=
0
;
...
...
@@ -56,13 +56,13 @@ int main(void)
printf
(
"
\n
Smallest: %d
\n
"
,
numbers
[
0
]);
printf
(
"Biggest: %d
\n
"
,
numbers
[
9
]);
// calculating the
sum
of the numbers and printing them out
// calculating the
arithmetic average
of the numbers and printing them out
for
(
a
=
0
;
a
<
n
;
a
++
)
{
sum
+=
numbers
[
a
];
average
+=
numbers
[
a
];
}
printf
(
"
Sum: %f
\n
"
,
sum
/
n
);
printf
(
"
Arithmetic Average: %f
\n
"
,
average
/
n
);
// finding the median
...
...
@@ -78,7 +78,7 @@ int main(void)
sumOfOdd
+=
numbers
[
j
];
}
}
printf
(
"Sum of Odd Numbers: %d"
,
sumOfOdd
);
printf
(
"Sum of Odd Numbers: %d
\n
"
,
sumOfOdd
);
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