int a,b,c,d; // declaring variables a,b,c and d

b=(a=50)+10; // example of chained statement

c=d=65; // example of embedded statement

printf ("a = %d b = %d c = %d d = %d",a,b,c,d);

}

Output

a = 50 b = 60 c = 65 d = 65

Start typing program with standard program name, comment for program,
include and void statements.

int a,b,c,d; statement will declare four variables a, b, c and d.

Next statement b = (a=50) + 10; is example of chained statement. It
will first assign 50 to a, then value of a 50 + 10 i.e 60 will be assigned to
variable b. Chained statement will help to assign multiple variable in one
statement.

Next statement c = d = 65; is example of embedded statement. It will
assign value 65 to c as well as d variable.

If you observe properly, in printf statement, for variable a it
will display value 50, for b variable it will display 60. For c and d it will
display value 65. Variable a and b are example of chained statement, whereas
variable c and d are example of embedded statement.

Thank You for visiting www.cbtSAM.com. This site is dream of Samir Patel, while most people dream when in sleep, my dream doesn't let me sleep. cbtSAM Web site is provided as a service & learning tool to public. While the information contained within the site is periodically updated, no guarantee is given ... Read More...