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

  • Published on
    17-Jan-2016

  • View
    213

  • Download
    0

Transcript

Objective:

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

Recommended

View more >