What is the difference between = and == in C?
Answer Posted / 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 |
Post New Answer View All Answers
what is multiplexer?
How do you size NMOS and PMOS transistors to increase the threshold voltage?
You have three adjacent parallel metal lines. Two out of phase signals pass through the outer two metal lines. Draw the waveforms in the centre metal line due to interference. Now, draw the signals if the signals in outer metal lines are in phase with each other
Explain CMOS Inverter transfer characteristics?
Differences between Array and Booth Multipliers?
Explain what is multiplexer?
Why do we gradually increase the size of inverters in buffer design? Why not give the output of a circuit to one large inverter?
What are the changes that are provided to meet design power targets?
6-T XOR gate?
What types of CMOS memories have you designed? What were their size? Speed?
What types of CMOS memories have you designed? What were their size? Speed?
Explain the working of Insights of an inverter ?
Explain what is the use of defpararm?
Insights of a 4bit adder/Sub Circuit?
Basic Stuff related to Perl?