#include <stdio.h>


left(unsigned value,int n){

unsigned z;

z=(value>>(32-n))|(value<<n);

return z;

}

void main(){

unsigned a;

int n;

printf("please input a number:\n");

scanf("%o",&a);

printf("please input the number of displacemeng(>0):\n");

scanf("%d",&n);

printf("the result is %o\n",left(a,n));

}

vv.jpg

C语言把24循环左移2位