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


Please Help Members By Posting Answers For Below Questions

What is the best c++ book for beginners?

568


What data encapsulation is in c++?

590


What is the benefit of c++?

589


What is class and structure in c++?

552


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

561






What is pointer to array in c++?

613


What is the difference between c++ and turbo c++?

584


What is split a string in c++?

686


the first character in the variable name must be an a) special symbol b) number c) alphabet

599


What things would you remember while making an interface?

559


What is oop in c++?

595


What is a constructor in c++ with example?

574


What is the difference between while and do while loop? Explain with examples.

591


How is modularity introduced in C++?

763


What is an adjust field format flag?

641