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

Explain Process technology? What package was used and how did you model the package/system? What parasitic effects were considered?

0 Answers   Intel,


What is SPICE?

4 Answers   Intel,


What are the changes that are provided to meet design power targets?

0 Answers  


For an AND-OR implementation of a two input Mux, how do you test for Stuck-At-0 and Stuck-At-1 faults at the internal nodes? (You can expect a circuit with some redundant logic)

0 Answers   Infosys,


What's the price in 1K quantity?

0 Answers   Wipro,






Draw Vds-Ids curve for a MOSFET. Now, show how this curve changes with increasing Vgs.

0 Answers   Infosys,


What are the different design constraints occur in the synthesis phase?

0 Answers  


Insights of a 2 input NAND gate. Explain the working?

1 Answers   Intel,


Given a layout, draw its transistor level circuit. (I was given a 3 input AND gate and a 2 input Multiplexer. You can expect any simple 2 or 3 input gates)

0 Answers   Infosys,


Given a circuit and asked to tell the output voltages of that circuit?

1 Answers   Intel, Omega Healthcare,


What is setup time and hold time?

1 Answers   Intel,


Implement F= not (AB+CD) using CMOS gates?

0 Answers   Intel,


Categories