UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the difference between n=1 and n==1 in the C language?

Asked by Last Modified  

Follow 11
Answer

Please enter your answer

Computer Trainer: Programming & Software Development.

'=' is ASSIGNMENT operator , where as '==' is COMPARISON operator. int a=7; assigns the variable a an integer value 7 , where as a==7; checks if the VALUE of a is EQUAL to 7.
Comments

Trainer

'=' 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...
read more

'=' 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
Comments

Experienced & certified IT Professional Trainer empowering students to reach their potential.

'=' 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...
read more

'=' 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
Comments

In c n==1 is correct coding n=1 is not correct
Comments

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 more

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
Comments

Computer Science Tutor

= 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....
read more

= 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 less
Comments

yes! 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...
read more

yes!

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 less
Comments

Computer classes For Working professionals and studne of Engineering, MCA, Class 12,11 class 10

n=1 means. you are assigning value 1 to n. value 1 is stored in variable n. = is an assignment operator where as n==1 means you are checking for equality. It checks whether value of n equls to 1. == is relational operator
Comments

View 6 more Answers

Related Questions

What are the applications of C programming?
Hi Poulami Hope you are doing good. C programming language is a versatile and widely used language that has found applications in various domains. Some of the key applications of C programming include: 1....
Poulomi
0 0
6
Who is the inventor of C programming?
Dennis Ritchie is inventor of C programming language.
Shreya
0 0
7
Is it necessary for a programmer to start his career by learning the C language first?
no, but c is the basic if u have good analysing skills need to learn if u learn c , you can easy to get the c++ else u have put some effort on this session f c++
Shilpa

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Why Indexing Should Start From Zero In Array ?
Why numbering should start at zero? To denote the subsequence of natural numbers 2, 3, ..., 12 without the pernicious three dots, fourconventions are open to usa) 2 ≤ i < 13b) 1 < i ≤ 12c)...

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

Structures in C
A structure is a collection of one or more data members possibly of different data types, grouped together under a single name for convenient handling. Defining a Structure: In general terms,...

Features Of C Language
Features of C language It is a robust language with rich set of built-in functions and operators that can be used to write any complex program. The C compiler combines the capabilities of an assembly...

Recommended Articles

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...

Read full article >

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...

Read full article >

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,...

Read full article >

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...

Read full article >

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 you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more