CSE 100 Lecture Notes - Lecture 9: Algebraic Equation, Local Variable

51 views4 pages

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;

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