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 is the structure of a C program?
A C program typically starts with preprocessor directives, followed by global variable declarations. It then defines functions, one of which must be the main() function, serving as the entry point. The...
Igno
0 0
5
What does # mean in C?
#include is a preprocessor directive which is used to include user-defined file.
Sridevi
0 0
5
Can an ECE graduate with some knowledge of C language learn SQL?
Yes ECE graduate student learn SQL languuage bcuz SQL is. A structured query language. it all query depends upon the logic. In which table is used Nd database is maitained
Anand
0 0
5
Can anybody provide me error free coding for graphic program in C??? Animated Smiley program Rotating Fan progran Sunrise program
#include graphics.h #include conio.h #include stdlib.h #include dos.h main() { int gd = DETECT, gm,area,temp1,temp2,left =25,top=75; void *p; initgraph(&gd,&gm,”C:\TC\BGI”); setcolor(YELLOW); circle(50,100,25); setfillstyle(SOLID_FILL,YELLOW); floodfill(50,100,YELLOW); setcolor(BLACK); setfillstyle(SOLID_FILL,BLACK); fillellipse(44,85,2,6); fillellipse(56,85,2,6); ellipse(50,100.205,335,20,9); ellipse(50,100.205,335,20,10); ellipse(50,100.205,335,20,11); area...
Gayu
0 0
8
Give the structure of 'C' programming. Also, give significance of math.h and string.h header files.
Hi, C structure is procedural programming. math.h and string .h will have a declerations of predefined methods. math.h ex: sqrt(),...etc. string.h ex: strlen(),strcpy,...etc. if you wanna brif let meknow. Thanks.
Ishwari

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

Ask a Question

Related Lessons

Necessity of Theory and Practical in Computer Science.
Upon studying a subject both theory and practical are important. Usually many schools concentrate more on theory and the marks not on the practical. Other and opposite kind of people prefer practical...

Efficient Learning Strategies
Type your notes after class Write your notes onto flashcards - Scrabble -Make posters Review flashcards while walking, at gym, etc. Dog-ear pages in the reading where you can find...

C Program-Upper Case Demo
/*WAP to print the character entered by user in upper case*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ char ch; //Function for clearing screen clrscr(); ...

Working with C/C++ applications
Inorder to learn C and C++ programming languages one can work with various editors available.To name a few are the most popular one is turbo c++, DEV C++, Eclipse, NetBeans. Here are the screen shots...

What is a Programming Language
What is a Language? Language is a communication system of human. What is a programming Language? A programming Language is a formal constructed language design to communicate...

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