Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,166 questions

40,722 answers

573 users

How to use abs in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
         int a = 17, b = 390;
         
         Console.WriteLine(Math.Abs(-9));
         
         Console.Write(Math.Abs(a - b));
    }
}




 
/*
run:
 
9
373
 
*/

 





answered Dec 9, 2021 by avibootz
edited Dec 9, 2021 by avibootz

Related questions

2 answers 32 views
32 views asked Apr 27, 2023 by avibootz
1 answer 24 views
24 views asked Dec 20, 2022 by avibootz
1 answer 26 views
26 views asked Dec 19, 2022 by avibootz
1 answer 42 views
42 views asked Dec 10, 2021 by avibootz
...