Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
How to create an calculator using 1 line?
0
votes
asked
Feb 6, 2020
by
carl
Please
log in
or register to answer this question.
2 Answers
+1
vote
answered
Feb 6, 2020
by
anonymous
cal = op == '+' ? (a + b) : (op == '-' ? (a -b): (op == '*' ? (a*b): ( op == '/' ? (a / b): NAN ) ) );
Please
log in
or register to add a comment.
0
votes
answered
Feb 6, 2020
by
skinnypuppy1
(
140
points)
not sure it can be done in one line
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...