Advertisements
Advertisements
Question
Differentiate “=” and “==”.
Distinguish Between
Advertisements
Solution
- ‘=’ is an assignment operator which is used to assign a value to a variable that is on the left-hand side of an assignment statement.
- ‘=’ operator copies the value at the right side
of the operator to the left side variable. Ex. num = 10; means 10 assign to the variable num. - ‘= =’ is a relational operator. It is used to compare both operands are the same or not.
- Ex. num = = 10 means it compare num value with 10 and returns true(l) if both are same or returns false(0).
shaalaa.com
Lexical Units (Tokens)
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
Which of the following operator is an extraction operator in C++?
Can keywords be used as identifiers?
The following constant is of which type?
39
The following constant is of which type?
04.14
Write the following real constant into the exponent form:
23.197
Write the following real constant into the exponent form:
0.00005
Consider the following C++ statement. Are they equivalent?
char ch = 67;
char ch = ‘C’;
Determine which of the following are valid constant? And specify their type.
0.5
Determine which of the following are valid constant? And specify their type.
‘Name’
How relational operators and logical operators are related to one another?
