answersLogoWhite

0

A newline has ASCII character code 10, therefore you test for the integer value 10. That's not much use if the user needs to enter 10, therefore you should test the input before assigning the integer.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

While solving the LP problem any non integer variable in the solution is picked up to?

obtain the shortcut constaints


What is the difference between instantiation and initialization in C plus plus?

Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10


What is an integer constant in c plus plus?

A constant integer is an integer that is not expected to change value while it is in scope. Declaring any variable constant doesn't guarantee it won't change, but it does make it more difficult for a programmer to change the value by accident. Constant integers must be initialised at the point of instantiation. We can initialise a constant with the value of a literal constant, the value of another constant, or the value of a variable: void f (int v) { const int x {42}; // Integer constant (initialised from literal constant) const int y {x}; // Integer constant (initialised from another constant) const int z {v}; // Integer constant (initialised from a variable) // ... v *= 2; // ok -- v is variable x *= 2; // error: x is constant }


Is a variable a verb?

No, it is not a verb. "A variable" is a noun, while "variable" is an adjective.


What is a sqare whole number?

That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.


What is the difference between signed integer and unsigned integer in terms of memory and range?

Signed integer is any integer that carries negative sign while unsigned integer is any integer that carries positive sign


How does the independent and a dependent variable compare in a experiment?

In an experiment, the independent variable is manipulated or controlled by the researcher, while the dependent variable is measured to see the effect of the independent variable. The independent variable is the cause, while the dependent variable is the effect. Changes in the independent variable are expected to cause changes in the dependent variable.


Can newline be a white space?

Yes, a newline can be considered a type of whitespace character. In programming and text processing, whitespace typically includes spaces, tabs, and newlines, which serve to separate tokens and improve readability. While it does not produce visible space like a space or tab, it still plays a crucial role in formatting and structuring text.


What is the variable that scientist observes changing while conducting an experiment?

The variable that scientists observe changing while conducting an experiment is called the independent variable. This is the variable that is intentionally manipulated or changed by the scientist to observe its effect on another variable, known as the dependent variable.


What variable that a scientist observes to change while conducting an experiment is called the?

The variable that a scientist observes to change while conducting an experiment is called the independent variable. This is the variable that is deliberately manipulated by the scientist to observe its effect on the dependent variable.


Would battery be the independent variable and flashlight dependent variable in an experiment?

Nope. Dependent Variable is the variable that is being tested/measured while Independent variable is the variable is that can be changed.


What variable does the X axis show?

It shows the independent variable while the Y axis shows the dependent variable