|
-
May 29th, 2002, 08:19 AM
#1
Thread Starter
Frenzied Member
Negative Numbers
i have a as an integer but the output would be -a. does anyone not understand? here..if a user enters 5 the output would be -5. if a user enters -5 the output would be 5. How do i do this using this code:
[code]
#include <iostream.h>
void main()
{
cout << "Enter a: ";
int a;
cin >> a;
if(a == //i have no idea what to put here)
{
//something
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|