Difference between 'I' and 'II' operators.​

Answers 2

Solution. The / operator is used for division whereas % operator is used to find the remainder

Answer:

Explanation:What is the difference between = and == operators in C

Interview Questions

What is the difference between = and == operators in C.

What is the difference between pre increment operator(++var) and post increment operator(var++).

What is the difference between pre decrement operator(--var) and post decrement operator(var--).

What is the difference between “=” and “==” operators in C

First of all = is a assignment operator and == is a comparison operator.

= operator is used to assign value to a variable and == operator is used to compare two variable or constants.

The left side of = operator can not be a constant, while for == operator both sides can be operator.

What is the difference between pre increment operator(++var) and post increment operator(var++).

Pre increment operator(++var) first increment the value of variable by one and then it returns its value whereas post increment operator (var++) first returns the value of variable then increments its value by 1.

For Example :

int var = 2;

printf("%d", ++var);

Pre increment operator first increment the value of var to 3 and then returns its value. Above printf statement will print 3. Let. int var = 2;

printf("%d", var++);

Post increment operator first returns the value of var and then increments its value by one. Above printf statement will print 2 and value of var becomes 3.

What is the difference between pre decrement operator(--var) and post decrement operator(var--).

Pre decrement operator(--var) first decrement the value of variable by one and then it returns its value whereas post decrement operator (var--) first returns the value of variable then decrements its value by 1.

For Example :

printf("%d", --var);

Pre decrement operator first decrement the value of var by one and then returns its value. Above printf statement will print 1.

int var = 2;

printf("%d", var--);

Post decrement operator first returns the value of var and then decrement its value by one. Above printf statement will print 2 and value of var becomes 1.

If you know the answer add it here!

Can't find the answer?

Log in with Google

or

Forgot your password?

I don't have an account, and I want to Register

Choose a language and a region
How much to ban the user?
1 hour 1 day 100 years