Objective: Students will be able to: Declare and use variables Input integers

  • View

  • Download

Embed Size (px)



Objective:Students will be able to:Declare and use variablesInput integersVariablesHold dataCan be numbers, letters, wordsPlace in main memory that holds the data Has a name that is assigned by the programmerExampleint alice;

Type: int integer (whole number)alice: name of variable

Variable is declared.


program to input an integer and have it print out (echo) #include using namespace std; int main (void){ int alice; cin >>alice; coutaliceinput number for alicebill = alice;makes bill equal to alicecout> Alice >> Tom;Alice = Tom;Tom = Alice;cout Alice >>Tom;Save = Alice;Alice = Tom;Tom = Save:cout