CSE 100 Lecture Notes - Lecture 9: Algebraic Equation, Local Variable
Document Summary
Cse 100 lecture nine notes - example programs using chapters one through four. How to write a program to say hello, world! . Hello, world! cout << hello, world! ; /* outputs message hello, world!" */ return 0; Program demonstrates the use of the function cout. Program demonstrates the use of the function cout and cin. Program demonstrates a dynamic code block that both asks for user input and display the same variable. Program demonstrates how to declare a local variable in c++ Creating a program to add two variables and print the steps. #include using namespace std; int main () int firstval, secondval, sumofvals; cout << enter two values: ; cin >> firstval >> secondval; /* algebraic equation involving all three variables created */ sumofvals = firstval + secondval; /* outputs a full equation for better understanding */ cout << firstval << + << secondval << = << sumofvals; return 0;