What is the difference between = and == in C?
Answers were Sorted based on User's Feedback
Answer / veeramuthu k
'=' in c is the assignment opperator.whereas '==' is the
logical equality operator.
| Is This Answer Correct ? | 35 Yes | 0 No |
Answer / priyanka kokil
= is the assignment operator while == is equality operator
| Is This Answer Correct ? | 20 Yes | 0 No |
Answer / d.sreenu
= is assignment operator & == is equality operator in C
= operator is used to assign a value to the variable
== operator is used to compare two variables.
| Is This Answer Correct ? | 17 Yes | 0 No |
Answer / swapna
= is used for assigning the value to a variable
for example
int a=10;
if a=5
printf("%d",a);
else
printf("%d",a);
output:5
in this program a value is assigned to 5 and 5 is printed.
whereas
== is used to check the value of the variable
for example
int a=10;
if a==5
printf("%d",++a);
else
printf("%d",a);
output:10
in this value of a is checked with 10 .If it is equal if
stmt is true and a is incrementd and printed.
If it is not equal a value is printed.
| Is This Answer Correct ? | 14 Yes | 0 No |
Explain why present VLSI circuits use MOSFETs instead of BJTs?
what is the difference between the testing and verification?
Draw the timing diagram for a SRAM Read. What happens if we delay the enabling of Clock signal?
Explain the working of differential sense amplifier?
How binary number can give a signal or convert into a digital signal?
For a single computer processor computer system, what is the purpose of a processor cache and describe its operation?
Explain the working of 4-bit Up/down Counter?
How to improve these parameters? (Cascode topology, use long channel transistors)
What is the most complicated/valuable program you written in C/C++?
23 Answers HCL, IBM, Intel, TCS, TVS, Wipro,
Implement a 2 I/P and gate using Tran gates?
Are you familiar with the term snooping?
What happens to delay if you increase load capacitance?