Creative Commons License Foxbond's Repo

/** (c) 2015 Michał (Foxbond) Chraniuk */
#include <stdio.h>


void konwersja (int n){
		 if (n <=0){
		 		return;
		 }
		 
		 int r = n % 2;
		 konwersja(n/2);
		 
		 printf("%d", r);
}


int main (){
		int n;
		do {
			 printf("Podaj n (wieksze od 0): ");
		   scanf("%d", &n);
	  }while(n<0);
		printf("Postac binarna: ");
		konwersja(n);
		getch();
		return 0;
}

> Back