When The Final Value Of An Expression Is Assigned To A Variable, It Will Be Converted To

(Correct Answer Below)

Reveal the answer to this question whenever you are ready.

When The Final Value Of An Expression Is Assigned To A Variable, It Will Be Converted To

erted to the data type of that variable. In the following statement, assume that area is a long int , while length and width are both ints: area = length * width;
Front

Advertisement

Since length and width are both ints, they will not be converted to any other data type. The result of the multiplication, however, will be converted to long so it can be stored in area. Watch out for situations where an expression results in a fractional value being assigned to an integer variable. Here is an example: int x, y = 4; float z = 2.7; x = y * z; In the expression y * z , y will be promoted to float and 10.8 will result from the multiplication. Since x is an integer, however, 10.8 will be truncated and 10 will be stored in

About the flashcard:

This flashcard is meant to be used for studying, quizzing and learning new information. Many scouting web questions are common questions that are typically seen in the classroom, for homework or on quizzes and tests. Flashcards vary depending on the topic, questions and age group. The cards are meant to be seen as a digital flashcard as they appear double sided, or rather hide the answer giving you the opportunity to think about the question at hand and answer it in your head or on a sheet before revealing the correct answer to yourself or studying partner. Some questions will include multiple choice options to show you the options involved and other questions will just have the questions and corrects answers. Simply reveal the answer when you are ready to check your work. Absolutely no cheating is acceptable.