GeeksforGeeks Solution For Hard Domain .Below You Can Find The Solution Of School Basic ,Easy ,Medium . Or Hackerrank Solution You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers
Problem :- Make Number Odd
Submit Your Solution :- Click Here
Solution :-
#include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int res=1;
while(n%2!=1)
{
res*=2;
n/=2;
}
cout<<res<<"\n";
}
return 0;
}
Output:-
0 Comments: