C++ Data Type int
C++ examples for Data Type:int
HOME
C++
Data Type
int
Description
Click the following links for the tutorial for Data Type and int.
Integral Types with Minimum and Maximum Values
A guess number game
Show the results of the arithmetic operators. Adding Two Numbers
Test for prime by checking for divisibility by all whole numbers from 2 to sqrt(n).
Convert temperature from Celsius degrees into Fahrenheit
Set output format to hexadecimal
Average 3 numbers using integer arithmetic.
Computes a circle with radius of 5 and 20.
Determines if it is Summer Olympics year, U.S. Census year, or both.
The negative of a variable that contains a negative value.
Computes the factorial of numbers with for loop, no recursive function
Countdown to the liftoff with a delay created by for loop.
Use variables and assignments to compute the area of a rectangle and display the result.
To express an integer in binary, precede it with the characters 0b or "0B"
Working with Unsigned Integers
Working with Different Types of Integers
Initializing integers using operators
Define an integer variable
Using unsigned literals
Reads in two integers and determines and prints if the first is a multiple of the second.
Reads an integer and determines and prints whether it's odd or even.
Reads in five integers and determines and prints the largest and the smallest integers. Use macro
Calculate the product of three integers
Calculate base exponent, integerPower(3, 4) = 3 * 3 * 3 * 3.
Declare array unsigned int 'values' with 5 elements and initialize the elements to even ints from 2 - 10.
Declare the variable longPtr to point type long.
Read input for Decimal, Octal and Hexadecimal Values
Using atoi to convert string to int
Use atol to convert string to long value
Using strtol to convert string to long integer.
Output integer and its 1's complement in decimal and hexadecimal.
Swapping integers.
Hexadecimal Literals
Octal Literals
Calculations with Integers
Formatting integer values
Converts a length in yards as a decimal value to yards, feet, and inches.
Test signed and unsigned integers
Demonstrate integer variables
Makes a number out of digits