+ 2

Can variable changes its value while the program is running

27th Feb 2018, 10:52 AM
Jay Fursule (jain)
Jay Fursule (jain) - avatar
3 Answers
+ 6
Yes, that is the whole point of having them. int age = 6; age = 7; age += 3; This creates an integer named “age” which has the value 6, it changes the value to 7, then adds 3 to the value. It is 10 at the end.
27th Feb 2018, 10:58 AM
Jacob Pembleton
Jacob Pembleton - avatar
+ 2
yes right
27th Feb 2018, 11:00 AM
Jay Fursule (jain)
Jay Fursule (jain) - avatar
0
var number = 1; for (int i = 0; i < 10; i++) number++; Console.Write(number); // run and see what happens
1st Mar 2018, 7:03 PM
Catalin Popinciuc
Catalin Popinciuc - avatar