C Program To Show The Use Of Chain Assignment.
Q6. Write a C program to show the use of chain assignment.
Solution:
#include<stdio.h> //standard input/output header file
#include<conio.h> //for clrscr()
int main()
{
int a,b,c;
clrscr(); //to clear the screen
a=15;
b=20;
c=a=b; //chain assignment
printf(“\n c=%d”,c);
getch(); //holds the clear until any key is pressed
return 0; //makes the main() function
}
OUTPUT:
c=20