answersLogoWhite

0


Best Answer

Answer

#include

#include

#include

void main()

{

long double x;

cout<<"\n Input number: ";

cin>>x;

cout<<"\n Number is "<

getch();

}

// smallest program i could figure out!!!! enjoy!!!

Answer

int abs(int num)

{

if(num < 0)

num = -num;

return num;

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

Use the abs() overloaded function (include stdlib.h and math.h).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write absolute value in c plus plus programmig code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an absolute code?

An absolute code is a computer code which only uses absolute addresses.


How do you write the program to find absolute value using if else in c language?

I'll help you with some pseudo-code (NOT ACTUAL CODE, DO NOT TRY TO COMPILE): int absvalue(int x) if x is below 0 return x * -1 else return x Also, I suggest you do your homework yourself.


Write down the Javascript code to swap the contents?

Assuming your textboxes' "name" attribute is "txt1" and "txt2" respectively, the code would be: function swap(){ var temp = document.txt1.value; document.txt1.value = document.txt2.value; document.txt2.value = temp; }


What is an absolute assembler?

An absolute assembler is a computing term for an assembler which generates code which uses only absolute addresses.


Where you do you write membership codes in franktown?

You can write it in store and write the code in enter special code


How absolute encoder work?

Using this measuring system, every position of the measurement range/angle is identified by a definite code on a glass or plastic disc. This code is represented on the disc in the form of light and dark regions within different tracks. This combination relates to an absolute numerical value. Thus, the position value is always directly available, counters are not necessary. In addition it is not possible to get continuously invalid values caused by interferences or loss of the supply voltage. Movements which are done while the system is turned off are immediately measured after the system is powered up. code disc with Gray Code


Code P105 on 2001 hyudai elantra?

Code P0105 means:Manifold absolute pressure circuit malfunction


Code P0105 on 2001 hyudai elantra?

Code P0105 means:Manifold absolute pressure circuit malfunction


Is there an absolute 'right' and 'wrong' way of writing pseudo code?

No. There is no "right way" and "wrong way" of writing pseudo code, let alone qualifying with "absolute". However, a pseudo code is "wrong" if it cannot be understood, or it is incorrect in semantic (what the code tries to describe, solve, etc)


Write down a PHP code to add a session variable?

The preferred way is to simply alter the session superglobal. &lt;?php $_SESSION['variable'] = "value"; ?&gt;


What is code p0106 code on 2006 freestyle?

Trouble code P0106 means: Manifold Absolute Pressure/BARO Sensor Range/Performance


When you write on envelopes do you write your post code or the post code where you are sending it to?

You write the post code of the address that you are sending the letter too, otherwise the postman won't know where to deliver your letter.