MIPI_BaseC_WebinarFRTK/18_Seminar05/07_greater_number_p13.c

13 lines
220 B
C
Raw Permalink Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
#include <inttypes.h>
int main(void)
{
unsigned int i,n, pow2=1;
scanf("%u",&n);
for(i=0; pow2<n; i++)
pow2 <<= 1; // pow2 = pow2 * 2
printf("%u %d\n",pow2,i);
return 0;
}