Joined
Last Seen
-4 Reputation Points
- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
0% Quality Score
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
0 Endorsements
Ranked #107.65K
1 Posted Topic
[CODE] #include <iostream> using namespace std; int main () { int cifre; cout<<"how many numbers has te binary number? "<<endl; cin>>cifre; int broj; cout<<"the number is: "<<endl; cin>>broj; int niz[cifre]; for(int i=0;i<cifre;i++){ niz[i]=broj%10; broj=broj/10; } double stepeni[cifre]; for(int i=0;i<cifre;i=i+1){ stepeni[i]=pow(2.0,i); } int dekadni=0; for(int i=0;i<cifre;i++){ if(niz[i]==1) dekadni=dekadni+stepeni[i]; } cout<<dekadni<<endl; system("pause"); …
The End.
bboy_fresh