C++ program for chain multiple assignments.

Q50. Write a C++ program to perform chain multiple assignments (as many as possible).

Ans.

#include<iostream.h>  //for standard input and output

#include<conio.h>     //for clrscr()

void main()

{

int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;

int a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,o1,p1,q1;

int r1,s1,t1,u1,v1,w1,x1,y1,z1;

int a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2;

int r2,s2,t2,u2,v2,w2,x2,y2,z2;

clrscr();  //for clear screen

a=b=c=d=e=f=g=h=i=j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=a1=b1=c1=d1=e1=f1=g1=h1=i1=j1=k1=l1=m1=n1=o1=p1=q1=r1=s1=t1=u1=v1=w1=x1=y1=z1=a2=b2=c2=d2=e2=f2=g2=h2=i2=j2=k2=l2=m2=n2=o2=p2=q2=r2=s2=10;

cout<<a;

getch();       //To hold the output screen

}

 

OUTPUT:

 10

 

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: