/*c program explaining shorthand operators*/
#include<stdio.h>#include<conio.h>
int main() {
int res;
res = 11;
res += 4;
printf("\nResult of Ex1 = %d", res);
res = 11;
res -= 4;
printf("\nResult of Ex2 = %d", res);
res = 11;
res *= 4;
printf("\nResult of Ex3 = %d", res);
res = 11;
res /= 4;
printf("\nResult of Ex4 = %d", res);
res = 11;
res %= 4;
printf("\nResult of Ex5 = %d", res);
return 0;
}
output
Result of Ex1 = 15Result of Ex2 = 7
Result of Ex3 = 44
Result of Ex4 = 2
Result of Ex5 = 3
Comments
Post a Comment