Buatlah flowchart untuk mengkonversi dari biner ke desimal
Contoh:
Input : biner = 00010001
Output : desimal = 17
Penyelesaian:
Listing Program 3 (Biner ke Desimal):
#include
#include
#include
main()
{
int i, j, n, b, x, y=0, z;
printf(“Masukkan bilangan biner [MAX 8]: ”);
fgets(biner, sizeof biner, stdin);
n=strlen(biner);
j=n-2;
for(i=0; i
{ if(biner[i]==0)
b=0;
else if(biner[i]!=0 || biner[i]!=1)
printf(“ERROR\n\n”);
else
b=1;
z=pow(2, j);
x=b*z;
y=y+x;
j–;
}
printf(“%d”, y);
printf(“\n\n”);
}
Algoritma Soal 3 (Biner ke Desimal)
1. Mendeklarasikan variabel yaitu :
int biner[8], a, I, jumlah=0
2. Masukkan biner sebanyak 8, yang menyatakan biner[].
3. Menghitung banyaknya biner yang menyatakan a = strlen(biner).
4. Tanyakan, apakah a<=8 ? 5. Jika tidak, maka cetak harus max 8 dan langsung ke no. 9. 6. Jika ya, maka langsung ke proses selanjutnya(no.7). 7. Proses Looping (i=0;i<8) b =" biner[i]*pow(2,">
5 komentar:
Hello !.
You may , probably curious to know how one can collect a huge starting capital .
There is no initial capital needed You may start earning with as small sum of money as 20-100 dollars.
AimTrust is what you haven`t ever dreamt of such a chance to become rich
The firm incorporates an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.
Its head office is in Panama with structures everywhere: In USA, Canada, Cyprus.
Do you want to become an affluent person?
That`s your chance That`s what you really need!
I feel good, I started to get income with the help of this company,
and I invite you to do the same. If it gets down to choose a correct partner utilizes your funds in a right way - that`s the AimTrust!.
I make 2G daily, and my first deposit was 1 grand only!
It`s easy to join , just click this link http://ojufejohe.envy.nu/ymopit.html
and lucky you`re! Let`s take this option together to become rich
Good day !.
You may , probably very interested to know how one can reach 2000 per day of income .
There is no initial capital needed You may start to get income with as small sum of money as 20-100 dollars.
AimTrust is what you haven`t ever dreamt of such a chance to become rich
The company represents an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.
It is based in Panama with affiliates everywhere: In USA, Canada, Cyprus.
Do you want to become an affluent person?
That`s your chance That`s what you really need!
I feel good, I started to take up real money with the help of this company,
and I invite you to do the same. It`s all about how to select a correct companion who uses your funds in a right way - that`s AimTrust!.
I earn US$2,000 per day, and my first investment was 500 dollars only!
It`s easy to start , just click this link http://jimiredycy.uvoweb.net/irywywe.html
and lucky you`re! Let`s take this option together to become rich
Hello!
You may probably be very interested to know how one can manage to receive high yields on investments.
There is no initial capital needed.
You may commense to get income with a money that usually goes
on daily food, that's 20-100 dollars.
I have been participating in one company's work for several years,
and I'm ready to let you know my secrets at my blog.
Please visit my pages and send me private message to get the info.
P.S. I earn 1000-2000 per day now.
http://theblogmoney.com
Good day, sun shines!
There have been times of troubles when I felt unhappy missing knowledge about opportunities of getting high yields on investments. I was a dump and downright stupid person.
I have never imagined that there weren't any need in big starting capital.
Now, I'm happy and lucky , I started take up real money.
It gets down to select a correct partner who utilizes your funds in a right way - that is incorporate it in real business, and shares the profit with me.
You may ask, if there are such firms? I have to answer the truth, YES, there are. Please get to know about one of them:
http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]
Glad to greet you, ladies and gentlemen!
We are not acquainted yet? It’s easy to fix,
friends call me Nikolas.
Generally I’m a venturesome gambler. for a long time I’m keen on online-casino and poker.
Not long time ago I started my own blog, where I describe my virtual adventures.
Probably, it will be interesting for you to read my notes.
Please visit my web page . http://allbestcasino.com I’ll be interested on your opinion..
Posting Komentar