Posts
 
Reputation
Joined
Last Seen
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
1 Commented Post
0 Endorsements
Ranked #107.65K
~281 People Reached
Favorite Forums
Favorite Tags
c++ x 1

1 Posted Topic

Member Avatar for ConfusedLearner

[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"); …

Member Avatar for bboy_fresh
0
281

The End.