Skip to content

Commit

Permalink
Merge pull request #103 from jgrynczewski/patch-1
Browse files Browse the repository at this point in the history
Update Ex_2.6_setbits.c
  • Loading branch information
orsenthil committed Oct 6, 2018
2 parents 7635d0e + a93c072 commit 1327fcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion languages/cprogs/Ex_2.6_setbits.c
Expand Up @@ -16,5 +16,5 @@ int main(void)

unsigned setbits(unsigned x,int p,int n,unsigned y)
{
return x & ~(~(~0 << n) << (p+1-n)) | ( y & ~(~0<<n)) << (p+1-n);
return x & ~(~(~0 << n) << (p+1-n)) | ( y & (~(~0<<n)) << (p+1-n));
}

0 comments on commit 1327fcd

Please sign in to comment.