46. WAP to understand compound assignment operator.
#include<stdio.h>
void
main()
{
int part;
printf("Program to understand -
compound assignment operators\n");
printf("Enter the part no :
");
scanf("%d",&part);
switch(part)
{
case 1:;
int i=2,j=3,k=4,l=5,m=6;
m = i <<= j += k *= l ^=
m;
printf("%d %d %d %d %d
\n",i,j,k,l,m);
break;
case 2:;
int n=0;
if(printf("HI
")>>2)
printf("%d\n",n++);
else
printf("%d\n",++n);
break;
}
}
Comments
Post a Comment