- Program :
#include <stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("\n----------------ASSIGNMENT OPERATORS----------------");
printf("\nEnter A and B values:");
scanf("%d%d",&a,&b);
printf("\n----------------ASSIGNMENT OPERATOR(=)----------------");
printf("\nAssign operator is : A= %d, B=%d",a,b);
printf("\n----------------ASSIGNMENT OPERATOR(+=)----------------");
printf("\nIncrements then assign is : %d",a+=b);
printf("\n----------------ASSIGNMENT OPERATOR(-=)----------------");
printf("\nDecrements then assign is : %d",a-=b);
printf("\n----------------ASSIGNMENT OPERATOR(*=)----------------");
printf("\nMultiplies then assign is : %d",a*=b);
printf("\n----------------ASSIGNMENT OPERATOR(/=)----------------");
printf("\nDivides then assign is : %d",a/=b);
printf("\n----------------ASSIGNMENT OPERATOR(%=)----------------");
printf("\nModulus then assign is : %d",a%=b);
getch();
}
- Output :
No comments:
Post a Comment