Quick actions

cmd+k|ctrl+k

Navigation

Languages

translate to binary translation

Snippet info

Language

C

Visibility

public

Author

markkoval510

Created

2016-10-12T21:53:57Z

Updated

2016-10-12T22:17:38Z

#include <stdio.h>

int main(void) {
    int n,i = 0;
    int ostacha = 0;
    int mas[10] = {0};
    printf("Enter your value!\n");
    scanf("%d",&n);
    while(n>=1)
    {
        ostacha = n % 2;
        mas[i]= ostacha;
        n = n/2;
        i++;
    }
    for(int j = i-1; j>=0;j--)
      {
          printf("%d",mas[j]);
      }
          
    getchar();
    return 0;
}
INFO