0
How can I use abs on C?
Please show me with code
10 Respostas
+ 3
Shakiba Majd the problem is that all of the places where it should have "\n" have instead "/n". Use back slash as the metacharacter, not forward slash.
Make certain to fix it in scanf() and printf(). Because of the invalid format, scanf() is reading the input wrong, and that is why your values are coming out wrong. The problem is not related to the abs() function. In fact, the program works remarkably well after this fix.
+ 3
See this i used abs in my Pattern program
https://code.sololearn.com/c4KinIeDq7ck/?ref=app
+ 3
Shakiba Majd where is your code post it
+ 2
Shakiba Majd you are welcome. Good job on the program. I did not know that technique of finding min and max. It makes a good challenge.
+ 1
#include<stdlib.h> header
Use like
abs(-10) returns 10
+ 1
Jayakrishnađźđł Thanks. But I want to find the maximum and the minimum,sum,product and average by taking four integers, and at the same time not using the condition structure so I need abs for it and my code isn't working properly!
https://code.sololearn.com/cm1tSpUQe6PC/?ref=app
My output must be up to six decimal places
+ 1
Brian You're right!! I forgot it...
Thank you so much for your explanation. Good luck đ
https://code.sololearn.com/ch4NZWSKENYf/?ref=app
0
đ
đđđ I saw it.Do you know what my code is not working?
0
Brian I'm glad about this, thanks.