What is the difference between = and == in C?

Answers were Sorted based on User's Feedback



What is the difference between = and == in C?..

Answer / veeramuthu k

'=' in c is the assignment opperator.whereas '==' is the
logical equality operator.

Is This Answer Correct ?    35 Yes 0 No

What is the difference between = and == in C?..

Answer / priyanka kokil

= is the assignment operator while == is equality operator

Is This Answer Correct ?    20 Yes 0 No

What is the difference between = and == in C?..

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

What is the difference between = and == in C?..

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

What is the difference between = and == in C?..

Answer / indian

I NEED MORE....

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More VLSI Interview Questions

What is pipelining and how can we increase throughput using pipelining?

1 Answers   Intel,


Draw the stick diagram of a NOR gate. Optimize it

0 Answers   Infosys,


For a NMOS transistor acting as a pass transistor, say the gate is connected to VDD, give the output for a square pulse input going from 0 to VDD

0 Answers   Infosys,


What is Fowler-Nordheim Tunneling?

2 Answers   Intel,


Explain why present VLSI circuits use MOSFETs instead of BJTs?

0 Answers  






What is the most complicated/valuable program you written in C/C++?

23 Answers   HCL, IBM, Intel, TCS, TVS, Wipro,


Explain what is the use of defpararm?

0 Answers  


Explain how Verilog is different to normal programming language?

0 Answers  


Differences between Array and Booth Multipliers?

0 Answers   Intel,


What happens to delay if you increase load capacitance?

3 Answers   Infosys,


Explain the various MOSFET Capacitances & their significance?

1 Answers  


What is Cross Talk?

4 Answers   Intel,


Categories