x

Choose Country Code

x

Direction

x

Ask a Question

  • Ask a Question
  • Scan a Question
  • Post MCQ
  • Note: File extension must be of jpg, jpeg, png, bmp format and file size must not exceed 5 MB
x

Ask a Question

x

Hire a Tutor

Answers and Solutions

What's Your Question?
Answer

Arithmetical operators are functions that take numbers as arguments and map onto a new number.

example: /,*,+,*,%,=,++,--

Logical operators are functions that take propositions (or whatever that can have only two different values, such as ‘true’ or ‘false’) and map them onto either one of those values. So the domain only contains two different things (typically ‘true’ and ‘false’).

example: &&,||, ! ..(AND/OR/NOT)

Answer
An expression containing logical operator returns either 0 or 1 depending upon whether expression results true or false. Logical operators are commonly used in decision making.logical operator return value 0 or 1. An arithmetic operator is a mathematical function that takes two operands and performs a calculation on them.
Answer
An expression containing logical operator returns either 0 or 1 depending upon whether expression results true or false. Logical operators are commonly used in decision making. An arithmetic operator is a mathematical function that takes two operands and performs a calculation on them.
Answer
  • logical operator return value 0 or 1.
  • arithmetic operator take numeric value as their operands and return a single numerical value.
Answer
Logical Operators An expression containing logical operator returns either 0 or 1 depending upon whether expression results true or false. Logical operators are commonly used in decision making in C programming . Operator Meaning of Operator Example && Logial AND. True only if all operands are true If c = 5 and d = 2 then, expression ((c == 5) && (d > 5)) equals to 0. || Logical OR. True only if either one operand is true If c = 5 and d = 2 then, expression ((c == 5) || (d > 5)) equals to 1. ! Logical NOT. True only if the operand is 0 If c = 5 then, expression ! (c == 5) equals to 0. Arithmetic Operators An arithmetic operator performs mathematical operations such as addition, subtraction and multiplication on numerical values (constants and variables). Operator Meaning of Operator + addition or unary plus - subtraction or unary minus * multiplication / division % remainder after division( modulo division).
Answer

Arithmetic Operators:

There are following arithmetic operators supported by C language:

 

Operator

Description

 

+

Adds two operands

 

-

Subtracts second operand from the first

 

*

Multiply both operands

 

/

Divide numerator by denumerator

 

%

Modulus Operator and remainder of after an integer division

 

++

Increment operator, increases integer value by one

 

--

Decrement operator, decreases integer value by one

 

Logical (or Relational) Operators:

 

Operator

Description

Example

==

Checks if the value of two operands is equal or not, if yes then condition becomes true.

(A == B) is not true.

!=

Checks if the value of two operands is equal or not, if values are not equal then condition becomes true.

(A != B) is true.

Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.

(A > B) is not true.

Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.

(A < B) is true.

>=

Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.

(A >= B) is not true.

<=

Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.

(A <= B) is true.

&&

Called Logical AND operator. If both the operands are non zero then then condition becomes true.

(A && B) is true.

||

Called Logical OR Operator. If any of the two operands is non zero then then condition becomes true.

(A || B) is true.

!

Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.

!(A && B) is false.

Answer

The logical OR operator ( ) returns the boolean value true if either or both operands is true and returns false otherwise. The operands are implicitly converted to type bool prior to evaluation, and the result is of type bool. Logical OR has left-to-right associativity.

Division. % (Modulo) Returns the integer remainder of a division. For example, 12 % 5 = 2 because the remainder of 12 divided by 5 is 2. The plus (+) and minus (-) operators can also be used to perform arithmetic operations on datetime and smalldatetime values.

Post Answer and Earn Credit Points

Get 5 credit points for each correct answer. The best one gets 25 in all.

Post Answer