Add C example

This commit is contained in:
michaelangel007 2020-02-05 09:38:31 -08:00
parent 375a0097f3
commit 012c1c71ac

23
rpm.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
int RPM( int a, int b )
{
int sum = 0;
while( b )
{
if( b & 1 )
sum += a;
a <<= 1;
b >>= 1;
}
return sum;
}
int main()
{
return printf( "%d\n", RPM( 86, 57 ) );
}