cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Equation in C
Equation in C
Nov 9, 2014 at 4:03pm UTC
prizko
(1)
Hey i am new new on this,i am in 9th grade in and i am trying to put a equation in c. Sorry for the english cause I´m from Portugal
float n1, y, pair;
cout << "Insert a number ";
cin >> n1;
And now I need to put in c
pair =(n1 / 2 == y)
pair =(2 * y == y)
pair = (n1 - y);
How i put this?
Last edited on
Nov 9, 2014 at 4:03pm UTC
Nov 9, 2014 at 5:14pm UTC
AbstractionAnon
(6954)
1
2
pair =(n1 / 2 == y) pair =(2 * y == y)
What are you trying to do here?
== is the equality operator and doesn't make any sense in this context. Also, y has not been initialized, so using it in an operation will give undefined results.
Topic archived. No new replies allowed.