C++ Data Type int

C++ examples for Data Type:int


Click the following links for the tutorial for Data Type and int.

  1. Integral Types with Minimum and Maximum Values
  2. A guess number game
  3. Show the results of the arithmetic operators. Adding Two Numbers
  4. Test for prime by checking for divisibility by all whole numbers from 2 to sqrt(n).
  5. Convert temperature from Celsius degrees into Fahrenheit
  6. Set output format to hexadecimal
  7. Average 3 numbers using integer arithmetic.
  8. Computes a circle with radius of 5 and 20.

  9. Determines if it is Summer Olympics year, U.S. Census year, or both.
  10. The negative of a variable that contains a negative value.
  11. Computes the factorial of numbers with for loop, no recursive function
  12. Countdown to the liftoff with a delay created by for loop.
  13. Use variables and assignments to compute the area of a rectangle and display the result.
  14. To express an integer in binary, precede it with the characters 0b or "0B"
  15. Working with Unsigned Integers
  16. Working with Different Types of Integers

  17. Initializing integers using operators
  18. Define an integer variable
  19. Using unsigned literals
  20. Reads in two integers and determines and prints if the first is a multiple of the second.
  21. Reads an integer and determines and prints whether it's odd or even.
  22. Reads in five integers and determines and prints the largest and the smallest integers. Use macro
  23. Calculate the product of three integers
  24. Calculate base exponent, integerPower(3, 4) = 3 * 3 * 3 * 3.
  25. Declare array unsigned int 'values' with 5 elements and initialize the elements to even ints from 2 - 10.
  26. Declare the variable longPtr to point type long.
  27. Read input for Decimal, Octal and Hexadecimal Values
  28. Using atoi to convert string to int
  29. Use atol to convert string to long value
  30. Using strtol to convert string to long integer.
  31. Output integer and its 1's complement in decimal and hexadecimal.
  32. Swapping integers.
  33. Hexadecimal Literals
  34. Octal Literals
  35. Calculations with Integers
  36. Formatting integer values
  37. Converts a length in yards as a decimal value to yards, feet, and inches.
  38. Test signed and unsigned integers
  39. Demonstrate integer variables
  40. Makes a number out of digits