cin Handles unsigned int Data Types : unsigned int « Data Types « C++ Tutorial






#include <iostream>
using namespace std;

int main()
{
   int myInt;
   long myLong;
   double myDouble;
   float myFloat;
   unsigned int myUnsigned;

   cout << "Int: ";
   cin >> myInt;
   cout << "Long: ";
   cin >> myLong;
   cout << "Double: ";
   cin >> myDouble;
   cout << "Float: ";
   cin >> myFloat;
   cout << "Unsigned: ";
   cin >> myUnsigned;

   cout << "\n\nInt:\t" << myInt << endl;
   cout << "Long:\t" << myLong << endl;
   cout << "Double:\t" << myDouble << endl;
   cout << "Float:\t" << myFloat << endl;
   cout << "Unsigned:\t" << myUnsigned << endl;
   return 0;
}








2.16.unsigned int
2.16.1.unsigned int and unsigned long
2.16.2.Demonstrates arithmetic operations with unsigned int variables
2.16.3.cin Handles unsigned int Data Types
2.16.4.unsigned int: Subtraction and Integer Overflow
2.16.5.Tests signed and unsigned integers
2.16.6.Difference between signed and unsigned integers