Related questions with answers
Question
Create a variable myage and store your age in it. Subtract 2 from the value of the variable. Add 1 to the value of the variable. Observe the Workspace Window and Command History Window as you do this.
Solution
VerifiedAnswered 1 year ago
Answered 1 year ago
Step 1
1 of 5Let us first create a variable of name myage
and store the age in it by using assignment statement as follows.
>> myage = 18
myage =
18
As we did not add a semicolon (;
) at the end of the statement myage=18
, the compiler prints the output as well just after the execution of the statement. If we want to suppress the output, we have to add a semicolon at the end of the statement, like myage = 18;
.
Create a free account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Create a free account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Recommended textbook solutions

MATLAB: A Practical Introduction to Programming and Problem Solving
4th Edition•ISBN: 9780128045251 (1 more)Stormy Attaway461 solutions

Fundamentals of Database Systems
7th Edition•ISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe961 solutions

Introduction to Algorithms
3rd Edition•ISBN: 9780262033848Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen872 solutions

Introduction to Algorithms
4th Edition•ISBN: 9780262046305Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen945 solutions
More related questions
1/4
1/7