Odpowiedź
#include <iostream>
using namespace std;
int main()
{
int number; // for allocation dirty number;
int valueX = 1;
cout << "Podaj liczbę: ";
cin >> number;
while(valueX * 2 < number)
valueX *= 2;
}
cout << "\nPotęga liczby 2 wynosi -> " << valueX << endl;
cout << "Twoja liczba wynosi -> " << number;
return 0;
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
Odpowiedź
#include <iostream>
using namespace std;
int main()
{
int number; // for allocation dirty number;
int valueX = 1;
cout << "Podaj liczbę: ";
cin >> number;
while(valueX * 2 < number)
{
valueX *= 2;
}
cout << "\nPotęga liczby 2 wynosi -> " << valueX << endl;
cout << "Twoja liczba wynosi -> " << number;
return 0;
}