Learn C Language from the Best Tutors
Search in
'=' is used to initialized value to a variable (ASSIGNMENT operator )
'==' is relational operator which is used to compare with two variables in If condition statements
example n=1; in this statements 1 will be assign to variable n
next , n==1;
here it will check ...is n equal to 1 or not ;
if it is equal it will return true value or it will execut if statement
if(n==1) // it is true so it executs statement
{
statement;
}
thank u
read less
'=' is the most commonly used assignment operator. An assignment operator is used for assigning a value to a variable.
So n=1 means variable n is assigned with value 1.
whereas '==' means an equal to operator which is a relational operator. A relational operator checks the relationship between two operands. If the relation is true, it returns 1; if the relation is false, it returns value 0. Relational operators are used in decision making and loops.
So n==1 means it's checked whether the variable n holds the value 1.
read less
1. n=1 means assigning 1 to n.
2. n==1 means comparing n with 1.
Eg: if(n==1)
n value is 1 condition is true and if condition is also true condition will execute i.e output is 1.
n value is other than 1 if conidition is false condition will not work. i.e. output is 0.
read less= and == both are operators in c. The = sign is known as assignment operator wehreas == is known as logical operator.
The assingment operator is used to assign a vaule (or varibale) to a variable. For example, n=1 (or n=a). This means that the vaule of n is 1.
The == operator is used for logical opearation. For example if(n==1), that is the value of n is compared to 1, if it is true i.e n is equal to 1, then true statements are executed else false statements are executed.
read lessyes!
As my tutor Shri Badri Gopi Krishna sir said, = operator is used to assigne a value to a variable. By using it a value will be stored in the memory of a variable, and == operator is used to compire a value with another i.e. compire L (Left side) value with R (Right side) value. We can also check the values stored in two variables are equal or not like (a=b=1;) to check is both a and b has same value or not we can use ( a==b ) if both are equal value it returns True else False we can use this == operator morly with IF condition
read lessView 6 more Answers
Related Questions
Program to accept a list of elements and find the maximum number in the list.
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Brilliant Academy, a reputed B. Tech Tuition...
Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...
Lasya Infotech: An educational Training...
Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...
Learn Hadoop and Big Data
Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...
Make a Career in Mobile Application Programming
Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...
Looking for C Language Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for C Language Classes are on UrbanPro
The best Tutors for C Language Classes are on UrbanPro