-
C] 1byte의 자연수를 반대방향의 2진수로 출력Study/C 2008. 3. 13. 20:43This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
/*1byte 의 자연수를 반대방향의 이진수로 출력*/ #include <stdio.h> void main() { int a, num, i; printf("Input any number: "); scanf("%d", &num); for(i=0; i<8; i++) { a = num%2; num = num/2; printf("%d", a); } printf("\n"); } 반응형'Study > C' 카테고리의 다른 글
C] 0 입력할 때까지 입력받은 숫자들의 최소, 최대, 평균 (0) 2008.03.24 C] 두 자연수를 입력받아 nCr 출력 (0) 2008.03.21 C] for문을 이용한 도형 찍기 (0) 2008.03.21 C] 이차방정식 근 구하기 (0) 2008.03.17 C] 소수(prime) 출력 프로그램 (0) 2007.10.15