Kursy
Zaloguj sięZacznij uczyć się AI
Kursy
Zaloguj sięZacznij uczyć się AI
+ 1

write a program in C# to Check whether given number is power of 2 or not

powerisor2notofgivenchecknumberwhether
24th Nov 2016, 4:43 PM
Deepashri Bharat Barve
Deepashri Bharat Barve - avatar
2 odpowiedzi
+ 3
if((x != 0) && ((x & (x - 1)) == 0)) { //the number is power of 2. }
24th Nov 2016, 6:18 PM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar

Często masz takie pytania?

Ucz się bardziej efektywnie, za darmo:

  • Wprowadzenie do Pythona

    7.1M uczących się

  • Wprowadzenie do Java

    4.7M uczących się

  • Wprowadzenie do C

    1.5M uczących się

  • Wprowadzenie do HTML

    7.5M uczących się

Zobacz wszystkie kursy
Popularne dzisiaj
Hello can anyone help me to learn gdscript
0 Votes
What coding language should i use to make a custom coding language?
0 Votes
hello world i need help
2 Votes
Any easy game ideas for beginners?
0 Votes
Which is more important CSS vs HTML vs JS?
1 Votes
How many courses are there on Sololearn
1 Votes
help string permutation
0 Votes
Hello! I’m 15 and I want to learn programming to become a web developer. Any advice?
0 Votes
hi
1 Votes
Which databases are the best at injecting dynamic data within websites, and how can you achieve it?
0 Votes