0
Can some fix this. ( code in description)
#include <iostream> using namespace std; int main() { int num; cout << "Enter any number:"; cin >> num; cout << num << endl << endl; if(num>0) { cout<<"The absolute value of number is:"<<num; } if(num<0) { cout<< "The absolute value is: " << num*-1; } return 0; }
2 odpowiedzi
+ 1
you probably have used some special characters inside the code (like tab), because if you delete all spaces the code works...
0
u better define new num = num * -1
but first lemme see the error