CSE 5J Lecture 4: Variables and Arithmetic Operators

45 views2 pages
20 Mar 2018
School
Course
Professor

Document Summary

Cmps 5j - lecture #4 - variables and arithmetic operators. A named location in the computer"s memory - it keeps track of a value that you can change later on. A certain variable can only store a certain type of value, for example, they can only store. In the example below, int is the type of variable, while x is the name of the variable in an integer, or a floating point, etc -- they cannot change throughout your code. which it is identified by. Int is an integer, or just a whole number. The statement in example 2 declares and initializes the variable x . Declaring means that it sets aside a place in memory for x (ex. Initializing a variable means that you assign a value to a variable for the first time (ex. Example 1: variable syntax int x; //declares variable x = 0; //initializes variable.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions