answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which operator in 'c' takes only integer operands?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is operand in c plus plus?

An operand is the value that is being operated upon by an operator. For instance, the C++ increment operator (++) is a unary operator, which means it has only one operand, the variable that we wish to increment. This in the expression x++, x is the operand. The addition operator (+) is a binary operator and therefore has two operands. Thus in the expression x + y, x and y are the operands.


What is conditional expression operator?

The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows:The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.If the first operand evaluates to true (1), the second operand is evaluated.If the first operand evaluates to false (0), the third operand is evaluated.The result of the conditional operator is the result of whichever operand is evaluated - the second or the third. Only one of the last two operands is evaluated in a conditional expression.


What is plus operator is it unary or binary?

There is no unary plus in C, but if there were, it would have only one operand, unlike the binary plus which has two: x = a + b; /* binary plus */ x = + b; /* unary plus -- not in C*/ x = a - b; /* unary plus */ x = - b; /* unary minus */


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&amp; 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 Syntax of remainder operator in c language?

% = Shift + 5 Example: printf ("7%%3=%d\n", 7%3); result: 7%3=1 one more thing this operator works only with integer type numbers not floating numbers.

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


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

true


What is ternery oparetor?

A ternary operator takes 3 operands. The only one I can think of in C# or C is the"? :" operator: ? : For example:Console.Write(1==2 ? "Huh?" : "Impossible"); //Impossible is printed


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.?

Both statements are true.


What is a conjunction in math?

A conjunction is a mathematical operator that returns an output of true if and only if all of its operands are true.


What is operand in c plus plus?

An operand is the value that is being operated upon by an operator. For instance, the C++ increment operator (++) is a unary operator, which means it has only one operand, the variable that we wish to increment. This in the expression x++, x is the operand. The addition operator (+) is a binary operator and therefore has two operands. Thus in the expression x + y, x and y are the operands.


What is conditional expression operator?

The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows:The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.If the first operand evaluates to true (1), the second operand is evaluated.If the first operand evaluates to false (0), the third operand is evaluated.The result of the conditional operator is the result of whichever operand is evaluated - the second or the third. Only one of the last two operands is evaluated in a conditional expression.


Distinguish between operator overloading and function overloading?

in C++ there is no real difference as operators are overloaded by implementing them as functions. However, while we differentiate between function overloads by the function signature (the number and type of parameters), operator overloads are distinguished only by the parameter types. The parameters are interpreted as operands, and the number of operands will depend upon whether the operator is unary, binary or ternary. That is, for any given operator, the number of operands will be the same for each overload you implement. The only exceptions are the unary increment (++) and decrement (--) operators as they each have postfix and prefix variants. In order to differentiate their signatures, an unreferenced or dummy parameter must be passed to the postfix variants.


How do you find the product of 16?

"Product" is a binary operator. A binary operator takes two numbers as input and combines them into an output. Your question gives only one number as input and so a sensible answer is impossible. "Product" is a binary operator. A binary operator takes two numbers as input and combines them into an output. Your question gives only one number as input and so a sensible answer is impossible. "Product" is a binary operator. A binary operator takes two numbers as input and combines them into an output. Your question gives only one number as input and so a sensible answer is impossible. "Product" is a binary operator. A binary operator takes two numbers as input and combines them into an output. Your question gives only one number as input and so a sensible answer is impossible.


What is plus operator is it unary or binary?

There is no unary plus in C, but if there were, it would have only one operand, unlike the binary plus which has two: x = a + b; /* binary plus */ x = + b; /* unary plus -- not in C*/ x = a - b; /* unary plus */ x = - b; /* unary minus */


What is the definition for and?

Conjunction Used to connect words of the same part of speech, clauses, or sentences that are to be taken jointly: "bread and butter". Noun A Boolean operator that gives the value one if and only if all the operands are one and otherwise has a value of zero.