To create a variable, you must specify the type and assign it a value:
int myNum;
myNum = 15;
System.out.println(myNum);;// Now myNum is 10
Note: If you assign a new value to an
existing variable, it
will overwrite the previous value:
Note that if you assign a new value to an existing variable, it will overwrite the previous
value:
printf("Hello World!");
In many other programming languages (like Python, Java, and
C++), you
would normally use a print function to display the value of a variable. However, this is not
possible in C:
int myNum = 15;
printf(myNum); // Nothing happens