Answers for "variable data types bit c++"

C++
1

initialize int c++

// operating with variables

#include <iostream>
using namespace std;

int main ()
{
  // declaring variables:
  int a, b;
  int result;

  // process:
  a = 5;
  b = 2;
  a = a + 1;
  result = a - b;

  // print out the result:
  cout << result;

  // terminate the program:
  return 0;
}
Posted by: Guest on April-22-2020
8

All data types in C++

Data Type 										Size
int (Integer) = 5, 6, 7							2
float (Floating Value) = -3.67, 2.67			4
double (Double of float) = -7.8746				8
char (Character) = 	'a', 'b', 'A'				1
string (Multiple chars) = "Hello World" 		No of Chars
bool (Boolean) = true, false					true = 1, false = 0
Posted by: Guest on November-13-2020

Browse Popular Code Answers by Language