Imam program, v katerem vnesem število, napr 12, on mi pa izpiše v dvojiškem 0011, kar seveda ni prav, saj bi moral 1100. Se pravi, je treba te številke obrniti. Pa poskušam, in mi ne rata. Koda je v C-ju.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
int vnos;
int x;
char tabela[100];
int i=0;
scanf("%d",&vnos);
while(vnos>0)
{
x=vnos%2;
vnos=vnos/2;
tabela*=x;
printf("%d",x);
}
for(i=strlen(tabela)-1; i>=0; i--)
{
printf("%c",tabela*);
}
}**