Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
makuks
/
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
208a749f
authored
Nov 12, 2018
by
makuks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
5396a095
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
Homeworks/Homework1.c
Homeworks/Homework1.c
0 → 100644
View file @
208a749f
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int
main
(){
double
A
;
double
B
;
double
N
;
double
H
;
double
x
;
double
y
;
double
nominator
;
double
denominator
;
printf
(
"Please enter the starting value: "
);
scanf
(
"%lf"
,
&
A
);
printf
(
"Please enter the enter the stopping value: "
);
scanf
(
"%lf"
,
&
B
);
printf
(
"Please enter the number of steps: "
);
scanf
(
"%lf"
,
&
N
);
H
=
(
B
-
A
)
/
N
;
for
(
x
=
A
;
x
<=
B
;
x
+=
H
){
printf
(
"x value: %lf "
,
x
);
nominator
=
(
2
*
x
)
+
1
;
denominator
=
(
pow
(
2
*
pow
(
x
,
2
)
+
3
*
x
+
4
,
3
));
if
(
denominator
<
0
){
printf
(
"Function value is a complex number"
);
}
else
{
if
(
denominator
==
0
){
printf
(
"Function value is not available"
);
}
else
{
denominator
=
sqrt
(
denominator
)
-
7
;
y
=
nominator
/
denominator
;
printf
(
"y value: %lf"
,
y
);
printf
(
"
\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