View Code of Problem 3700

#include <stdio.h>
#include<math.h>
int main() {
	int n;
	while (scanf("%d",&n)!=EOF&&n!=0)
	{
		int num = 0;
		while (n!=0)
		{
			if (n%2!=0)
			{
				int x = pow(2, num);
				printf("%d\n",x);
				break;
			}
			num++;
			n = n / 2;
		}
	}
	return 0;
	
}

Double click to view unformatted code.


Back to problem 3700