Enjoy my life~!!!

#include <stdio.h>


void convert(int dec){

int base = 2; // can change the base such as 3, 4 and so on...

if(dec > 0){

convert(dec/base);

printf("%d", dec % base);

}

}


int main()

{

int dec;

scanf("%d", &dec);

convert(dec);


return 0;

}


'Programming > Algorithms' 카테고리의 다른 글

Decimal to Binary with recursive function  (0) 2009/12/17
Fibonacci  (0) 2009/12/12
atoi function  (0) 2009/12/08
Bubble Sort  (0) 2009/12/08
Selection Sort  (0) 2009/12/07
1~1000(혹은 특정한 수) 안의 소수 구하기  (0) 2009/12/06
1 2 3 4 5  ... 98 
BLOG main image
Enjoy my life~!!!
Peace be with you
by 혜리사랑

공지사항

카테고리

BLUE (98)
Programming (29)
Research (10)
FUN (31)
Daily (20)
Scrap (5)
Statistics Graph
tistory!get rss Tistory Tistory 가입하기!