0% found this document useful (0 votes)
7 views

Assignment5 Loop3

The document contains instructions for 10 programming problems related to bit manipulation and number theory. The problems include reversing bits of an integer, counting bit pairs, finding longest bit runs, filtering numbers by digit sum and ordering, calculating factorials and Fibonacci sequences, testing primality and listing primes within a range while sorting the output digits.

Uploaded by

Arun Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Assignment5 Loop3

The document contains instructions for 10 programming problems related to bit manipulation and number theory. The problems include reversing bits of an integer, counting bit pairs, finding longest bit runs, filtering numbers by digit sum and ordering, calculating factorials and Fibonacci sequences, testing primality and listing primes within a range while sorting the output digits.

Uploaded by

Arun Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Write a program to reverse the bits of a supplied integer.

Note: reversing bits is not print reverse.

2. Write a program to Count the pairs of bits set in a supplied integer.

3. Write a program to find the longest series of 1’s in a supplied integer. Also print
the bit-position where the longest series is found.

4. Input a range of integer. Write a program to list the all the numbers whose sum
of digits(reduced to single digit) is 9.
e.g Min:500 max:550 then list should print as
504(5+0+4), 513(5+1+3), .... 549(5+4+9=18(1+8=9)... etc...

5. In the above program make arrangement, to list only numbers which are
ascending-order-digits.
e.g.. 246 , 2345,22344, 4444 are valid
but 643, 2202, 456756 are not valid.

6. Write a program to print the factorial of a given integer.

7. Write a program to print the fiboacci series upto a given count.


e.g if need to print 10 numbers in fibonacci series, then, output should be:
0,1,1,2,3,5,8,13,21,34.

8. Write a program to test the supplied integer is prime number or not?

9. List the prime numbers within a supplied range.

10. In the above program make arrangement to list those prime numbers , which
are sorted(digit-wise) , ascending or descending, both valid.

You might also like