Define the assignment operators in c language, C/C++ Programming

Assignment Help:

Define the Assignment Operators in c language?

The assignment operators can be used to assign a value to the variable and is represented by equal to (=) sign. The Assignment expression that make use of this operator are written in the form

Identifier = expression;

Where expression represents a constant and identifier represents a variable and a variable or an arithmetic expression.

C has some operators which offer abbreviation of certain types of arithmetic assignment statements. These operations are generally very efficient. They are able to combined with another expression.

x = a * b++; is equivalent to x = a*b; b = b+1;

Versions where the operator takes place before the variable name change the value of the variable before evaluating the expression, thus

x = --i * (a+b); is equivalent to i=i-1; x = i * (a+b);

These are able to cause confusion if you try to do too many things on one command line. You are recommended to limit your use of ++ and -- to ensure that your programs stay readable.

Another shorthand notation is listed below

Short hand         Equivalent

i += 10;              i=i+10;
i *= 10;              i=i*10;
i -= 10;              i=i-10;
i /= 10;              i=i/10;


Related Discussions:- Define the assignment operators in c language

Program to design list in c, Program to design list in c: Write a prog...

Program to design list in c: Write a program in c to insert the values in list void main() { int i=0; char a[20]; clrscr(); printf("Enter the line\n");

Loop, A company needs 200 pencils per year . you cannot simply use this pr...

A company needs 200 pencils per year . you cannot simply use this price as the cost of pencils two years from now. Because of inflation the cost is likely to be higher than it is

Define some features of static storage class in c program, Define some feat...

Define some features of static storage class in c program? The features of a variable defined to contain a static storage class are as follows. Storage - memory Default

Padovan stringf, A Padovan string P(n) for a natural number n is defined as...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.

String program, Write a C++ program which does the following: 1. Asks th...

Write a C++ program which does the following: 1. Asks the user to enter the following text "Four score and seven years ago there was a man named Joey Bagadonuts." 2. Save thi

Described the difference among "new" and "operator new" ?, Described the di...

Described the difference among "new" and "operator new" ? A:"operator new" works such as malloc.

Padovan string, padovan string program 1 : package test.padovanstring; ...

padovan string program 1 : package test.padovanstring; public class PadovanString {     public int stringOccurrences(int n, String str){        if(n >= 40)     return -

Program for basically a small store, ¦It should ask customers to enter deta...

¦It should ask customers to enter details such as their names and addresses. ¦It should print a welcome message that includes the customer’s name. ¦It should provide a list of avai

Using substitution model write corresponding constructor, (a) Pairs may be ...

(a) Pairs may be represented using a lambda. Using only lambdas, create a procedure (triple x y z) that constructs a triplet. You may NOT use car, cons or cdr in the triplet proced

Pebble merchent problem, There is a pebble merchant. He sells the pebbles, ...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd