answersLogoWhite

0


Best Answer

Both statements are true.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: State whether each what is TRUE or FALSE 1. All variables must be declared before they are used. 2. The modulus operator can be used only with integer operands.?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

The modulus operator can be used only with integer operands?

True


The modulus operator percent can be used only with integer operands?

True


Which operator in 'c' takes only integer operands?

modulus (%) and shift (<<, >>) for examples.


What The modulus operator percent can be used only with integer operands is true or false?

true


Where is the error in the following pseudocode Display enter the length of the room input length Declare Integer length?

The order of operations. Variables must be declared before they are used.


A quantity that can be equal to any integer and can take any different integer values is known as?

Integer variables


Is unsigned integer constant are available in Java?

yes use the final keyword, normally variables declared final use all capital letters but this is not required final int A = 10;


Which operand should be passed in the binary overloaded operator function as a second operand?

The right-hand operand; the r-value of the operator. Unary operators have one operand while tertiary operators have three operands. All binary operators have two operands, the l-value and the r-value. The l-value is the operand to the left of the operator while the r-value is the operand to the right of the operator. Thus, in the expression x + y, x is the l-value while y is the r-value. When overloading binary operators in a class, you need only specify the r-value. The l-value is the instance of the class to which the operator applies and therefore does not need to be specified. For instance: class MyClass { public: MyClass(int data=0):m_data(data){} // default constructor int operator+ (const int rhs) const {return(m_data+rhs);} private: int m_data; }; While this allows you to return the sum of your class instance and an integer, it does not allow you to return the sum of an integer and an instance of your class. For example: MyClass obj(5); int x = 10; int y = obj + x; // OK! y is 15. int z = x + obj; // Compiler error! No operator exists that accepts an r-value of type MyClass. To fix this error and allow for two-way addition, you must declare a binary operator overload outside of the class. You cannot do it inside the class because the l-value is an int, not an instance of MyClass. The external overload requires two parameters, the l-value and the r-value of the operator: int operator+(const int lhs,const MyClass& rhs) {return(rhs+lhs);} Note that the implementation simply reverses the operands. This is functionally equivalent to making the following explicit call: return(rhs.operator+(lhs)); Note also that since MyClass::operator+ is a public operator of MyClass, this overload does not need to be declared a friend of MyClass (a common misconception). However, the overload must be declared in the same file where the class is declared since it is only of relevance to MyClass but should be made available wherever MyClass is accessible.


What is the subtraction operator for Visual Basic?

You can just use the minus symbol "-", however, assure you type cast your variables correctly to get the values you wish (e.g. Integer / Double / Single) E.g. The following will result in int1 holding the value 2: Dim int1 As Integer = 3 Dim int2 As Integer = 1 int1 = int1 - int2


What variables in turbo C?

There are mainly 3 types of variables in c. Integer, Float and character :)


What are the variables in vb?

The variables is visual basic are the items being declared in order to use within the program, for example if you were writing a program for the SUVAT equations the variables would be difined as follows... Dim is as integer Dim iu as integer Dim iV as integer e.c.t Think of the Dim to mean declare and the "as integer" is the data type. If it was a text value (string) for example a name it would be declared as follows: Dim sname as string where sname is the variable. For an array of values you would do the same but as follows: dim sname(100) as string this would create a space so to speak for 101 (0-100) names which would be inputted as so: sname(0) = Dan sname(1) = Sarah e.c.t hope that helps without being to complicated


Can you declare printf for integer variable?

printf is declared in stdio.hFormat specifier for an integer value is %d.