answersLogoWhite

0


Best Answer

An assignment statement sets the value of a named object. This can be used to initialise the object's value or to change the object's value. The object may be a constant or variable, however you can only initialise a constant, not change it.

int i = 42; // Assigns the value 42 to the integer variable named i.

i = 0; // Replaces the value 42 with the value 0.

const double pi = 3.14; // Assigns the value 3.14 to the constant named pi.

pi = 3.14159; // Compiler error; pi is constant!

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

In assignment statements we use the schema

st.1 = st.2

what happen is that

the st.2 is sampled and solved if it's not a direct value

EX: st.1 = (1+14)*5

it's sampled to : st.1 = 75

then it's assigned to the variable st.1

so we can say that the right hand side of "=" is calculated then it's assigned to the left hand side.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

An assignment statement is any statement that includes an expression where an object is assigned a value. In most cases we use the assignment operator (=) to assign a value to an object however assignment can also be achieved through construction (initialisation). Constant variables are immutable and must always be initialised with a value at the point of instantiation. All other variables can be assigned a value at any time.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the purpose of an assignment statement?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

At the of a writing assignment get into the habit of asking yourself about the assignment's purpose?

beginning


What part of a writing assignment do you get into the habit of asking yourself about the assignment's purpose?

the introduction


Is it okay to not support your thesis statement in a personal essay?

Not if supporting your thesis statement was part of the assignment.


What is a statement in c language programme?

Any experssion including assignment or a function call can be a statement in C


Sample statement of purpose to join hotel industry?

can i know about statement of purpose?


What is WikiPedia's mission statement?

A mission statement is a statement of purpose written by the founders of a company. There is no publicly published mission statement for Wikipedia .


What is the optional in a variable declaration statement?

Optional is the assignment of the value of course.int number; //Variable Declarationint number=2; //Assignment Declaration


When a student begins a new reading assignment what should he or she do first?

he or she first open the book and reading assignment


What statement belong in a procedural languages but not in a non procedural language?

Assignment operator


What is the correct punctuation of David asked if the Week 4 assignment needed to be uploaded to Waypoint?

Since it is a statement that David asked, just treat it as a statement. "David asked if the Week 4 assignment needed to be uploaded to Waypoint."


What is a statement of intent and how is it different from a graduate student's statement of purpose?

Hi... Both of them are the same. The term statement of purpose is little old. The trend today is statement of intent. Regards


What would be the best thesis statement for an analytical essay?

The thesis statement depends on what you're doing the report on! You'll have to do your own assignment.