C++ int type negative variable

Description

C++ int type negative variable

#include <iostream>
using namespace std;
int main()//  w w w  .  jav a2  s  .  c  om
{
   signed int temp=-12;  // 'signed' is not needed because it is the default.
   cout << -temp << "\n";  // Produces a 12 on-screen.
   return 0;
}



PreviousNext

Related