Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
emonyi
/
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
6eaf413e
authored
6 years ago
by
emonyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
d9eca1f4
master
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
Homework1/Homework1Ccode.c
Homework1/Homework1Ccode.c
0 → 100644
View file @
6eaf413e
/**
* File: Homework1.c
* Author: ONYIA Emmanuel Chinedu
* created: 12.10.2018
* Last edit: 20.10.2018
*
* Desription:
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define LIMIT 15
int
main
(
void
)
{
//intialization of variables
double
t
;
float
A
=
0
;
int
i
=
0
;
int
N
=
0
;
float
H
=
0
;
float
x
;
double
y
;
//User enters values
//do-while statement ensuring user input A > 0; H > 0
do
{
printf
(
"Enter the starting value A for arguments: "
);
scanf
(
"%f"
,
&
A
);
if
(
A
<=
0
)
{
printf
(
"
\n
The starting value must be Greater than 0
\n\n
"
);
}
}
while
(
A
<=
0
);
do
{
printf
(
"Enter the step value H for arguments: "
);
scanf
(
"%f"
,
&
H
);
}
while
(
H
<=
0
);
printf
(
"
\n
s/n
\t
Arguments (X)
\t
Function(Y)
\n
"
);
x
=
A
;
//for loop for number of prints limit 15
for
(
N
=
0
;
N
<
LIMIT
;
N
++
)
{
//mathematical equation
x
+=
i
*
(
H
);
y
=
(
pow
(
sin
(
t
+
5
),
2
)
+
cos
(
t
))
/
(
x
+
exp
(
t
+
3
));
//output print statement
printf
(
" %d
\t
%0.2f
\t\t
%0.4f
\n
"
,
N
+
1
,
x
,
y
);
i
++
;
}
return
0
;
}
This diff is collapsed.
Click to expand it.
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