How to make a code which converts + to + or - to + in C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make a code which converts + to + or - to + in C

C

10th Sep 2023, 5:42 AM
Aaryan Singh Chauhan
Aaryan Singh Chauhan - avatar
11 Answers
+ 5
Hello! I’m glad to help you with your question. You’re inquiring about how to write a code that finds the absolute value of a number in C. There are several ways to do this, including using the built-in abs() function. However, if you want to implement this yourself, you can use conditional expressions or bitwise operations. I’ve attached a code example that explains everything from A to Z. I hope this helps! https://code.sololearn.com/ci3NwdO08oLi/?ref=app
11th Sep 2023, 4:37 AM
Moree
Moree - avatar
+ 3
Aaryan Singh Chauhan , Your question and the code you shared have contradictions...what exactly your question...??
10th Sep 2023, 9:47 AM
Riya
Riya - avatar
10th Sep 2023, 10:36 AM
Riya
Riya - avatar
+ 2
Share your code
10th Sep 2023, 6:10 AM
Sakshi
Sakshi - avatar
+ 2
Aaryan Singh Chauhan , Modulus operator can be represented by (%) ...used to calculate remainder... Eg:- a=10 b=2 rem=a%b So rem will Store the remainder value
10th Sep 2023, 10:18 AM
Riya
Riya - avatar
+ 2
Where is your attempt?? Firstly, share your attempt if there is any issue in the code then we can help you. We can't give you a readymate code.
10th Sep 2023, 11:44 AM
Gulshan Mahawar
Gulshan Mahawar - avatar
10th Sep 2023, 6:21 AM
Aaryan Singh Chauhan
Aaryan Singh Chauhan - avatar
0
I would like to know how to find modulus in c
10th Sep 2023, 10:10 AM
Aaryan Singh Chauhan
Aaryan Singh Chauhan - avatar
0
I mean f(x)=|x|
10th Sep 2023, 10:20 AM
Aaryan Singh Chauhan
Aaryan Singh Chauhan - avatar
0
How to use it in c
10th Sep 2023, 10:21 AM
Aaryan Singh Chauhan
Aaryan Singh Chauhan - avatar
0
use " abs(x) " function from stdlib.h header file.
11th Sep 2023, 5:26 AM
Md. Ashraful Islam
Md. Ashraful Islam - avatar