Search
 
SCRIPT & CODE EXAMPLE
 

CPP

increment c++

int main(){
  int i = 0;
  cout << i << endl; //Outputs 0
  i++; //Now i is 0 + 1
  cout << i << endl; // Outputs 1
  return 0;
}
Comment

C++ Increment and Decrement

	int b, a, e, d, c, f;
    int num = 57;
    cout << "The number is " << num << endl;

    b = ++num;
    a = ++num;
    e = a + 1;
    cout << "After post increment by 1, the number is " << b << endl;
    cout << "After pre increment by 1, the number is " << a << endl;
    cout << "After increasing by 1, the number is " << e << endl;

    d = --e;
    c = --e;
    f = c - 1;
    cout << "After post decrement by 1, the number is " << d << endl;
    cout << "After pre decrement by 1, the number is " << c << endl;
    cout << "After decreasing by 1, the number is " << f << endl;
Comment

PREVIOUS NEXT
Code Example
Cpp :: find max element in array c++ 
Cpp :: c vs c++ 
Cpp :: the code execution cannot proceed because glew32.dll was not found 
Cpp :: coordinate in 1d array 
Cpp :: array max and minimum element c++ 
Cpp :: c++ get character from string 
Cpp :: how to get the size of a vector in c++ 
Cpp :: struct and pointer c++ 
Cpp :: size of array 
Cpp :: reverse function in cpp string 
Cpp :: run cmd command c++ 
Cpp :: checking if a string has only letters cpp 
Cpp :: break in c++ 
Cpp :: c++ array size 
Cpp :: c++ lambda 
Cpp :: int to float c++ 
Cpp :: prisma client 
Cpp :: how do you wait in C++ 
Cpp :: chudnovsky algorithm c++ 
Cpp :: array to string c++ 
Cpp :: odd numbers 1 to 100 
Cpp :: find element in vector 
Cpp :: c++ erase remove 
Cpp :: c++ random generator 
Cpp :: cuda shared variable 
Cpp :: how to generate number in c++ 
Cpp :: map in c 
Cpp :: Nested if...else 
Cpp :: vector size 
Cpp :: selection sort c++ 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =