Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

To find Length of Binary Number in C++

0 votes
asked Mar 29, 2018 by zeeshan asad (120 points)
How to find the Length of Binary Number Stored in int type variable in C++?

2 Answers

–1 vote
answered Apr 3, 2018 by anonymous

<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?>
 

</body>
</html>

+1 vote
answered Apr 4, 2018 by coco
#include<stdio.h>

int main()

{

int n;//n is the integer of which binary representation length is to be calculated

int count=1;//binary length

while(n/2!=0)

{

count++;

n=n/2;

}

printf("%d",count);

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...