What is the difference between = and == in C?
Answer Posted / k.s. karthick prabu
= is the assigment operator
=is used to copy
ex:
a=5 means, copy just that value for 'a'.
== is comparision operator
ex:
#include<stdio.h>
void main()
{
int a;
scanf("%d",&a);
if(a==5)
printf("welcome");
else
printf("if the is not equal to 5");
}
| Is This Answer Correct ? | 37 Yes | 7 No |
Post New Answer View All Answers
Why namespace is used in c++?
What are the advantages of c++?
Why should we use null or zero in a program?
Can member data be public?
What is the return value of the insertion operator?
Why are pointers used?
What are static member functions?
What is ifstream c++?
Why struct is used in c++?
Can java be faster than c++?
How is data hiding achieved in c++?
What is c++ prototype?
Differentiate between a constructor and a method in C++.
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
Where Malloc(), Calloc(), and realloc() does get memory?