#include <stdio.h>
int main() {
int num = 10;
int shift_positions = 2;
// Left shift operator
int left_shifted = num << shift_positions;
printf("Left shifted result: %d\n", left_shifted);
// Right shift operator
int right_shifted = num >> shift_positions;
printf("Right shifted result: %d\n", right_shifted);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: