Uploaded by Dejon Baker

C++ Day2 Review (1)

advertisement
Slides 13 - 19
Statements, Output Statements, Case Sensitivity, Program Structure.
Exercise Review. Wrote C++ code for sum of two numbers algorithm.
#include <iostream>
using namespace std;
int main () {
int num1, num2, num3, avg;
cout << “enter first number”;
cin >> num1;
cout << “enter second number”;
cin >> num2;
cout << “enter third number”;
cin >> num3;
avg = (num1+num2+num3)/3;
cout << avg;
}
Download