You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
int a[10];
|
|
void Dec_to_Bin(int x)
|
|
{
|
|
int i = 0;
|
|
while(i < 10)
|
|
{
|
|
a[i] = x % 2;
|
|
x = x / 2;
|
|
i = i + 1;
|
|
}
|
|
}
|
|
int main()
|
|
{
|
|
int x;
|
|
x = getint();
|
|
Dec_to_Bin(x);
|
|
int i = 0;
|
|
while (i < 10)
|
|
{
|
|
putint(a[9-i]);
|
|
i = i + 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|