Answers for "declare int 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
0

how to write int variable c++

//Declare integer variable in C++
int x;
//Initialize integer variable
x = 1;

//Declaring and Initialize in same line
int y = 0;
Posted by: Guest on March-20-2021

Browse Popular Code Answers by Language