Results 1 to 6 of 6
Thread: ,
Hybrid View
-
18th June 2007 13:16 #1Registered User
Join Date: Jun:2005
Location: Sofia
Posts: 5
,
, . ...
, , ( ) 8 .
...
#include <stdio.h>
int main()
{
int a, i, ar[8];
for(i = 0; i < 8; i++)
ar[i] = 0;
scanf("%d", &a);
for(i = 0; a != 0; i++)
{
ar[i] = a % 2;
a = (int)(a / 2);
}
for(i = 7; i >= 0; i--)
printf(" %d", ar[i]);
return 0;
}
-
18th June 2007 13:53 #2EP43-DS3|E5200@3.33|ASUS EN9800GT HB /HTDI/ 512MB|2X2GB 800MHZ CL5 A-DATA|WD2500JB|NEC 4750A|BELINEA 1980S2
-
18th June 2007 15:08 #3
... " ...".
-
18th June 2007 17:26 #4Registered User
Join Date: Jun:2005
Location: Sofia
Posts: 5
10--->2 :
@ http://www.engin.umd.umich.edu/CIS/c...pp/binary.html
----------
#include <iostream.h>
void binary(int);
void main(void) {
int number;
cout << "Molq vyvedete polojitelno cqlo chislo: ";
cin >> number;
if (number < 0)
cout << "Ne e polojitelno cqlo chislo.\n";
else {
cout << number << "Prekodirano v dvoichna brojna sistema e: ";
binary(number);
cout << endl;
}
}
void binary(int number) {
int remainder;
if(number <= 1) {
cout << number;
return;
}
remainder = number%2;
binary(number >> 1);
cout << remainder;
}
@Salinski: , , . . , , , ... .
@entium: , , .
-
18th June 2007 18:00 #5
-
18th June 2007 19:52 #6
@emanuel40, .
, . (.. 3.1415 3 0.1415).
() , ".", 256, . 8 . 16 , 65536.
, 11 ( , , , ).
!, . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel




Reply With Quote

, . . 
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in