Placement Test
C Problem Statements
1 / 2
Category: Subjective Questions
1. Problem Statement: Find a bit sequence in a number
1)Given an Input number N which is of type Int.
Find:
1)if a particular sequence (“1001”) is present yes or no
2)If present how many times
For example
Its binary value is
11 1010 1001 0111
Output :
1)Sequence is present
2)Number of times= 1
output:
1)sequence is present
2) Number of times= 1
c)int c= 875
output
1)sequence is absent
2)no of times =0
Note: if its 1001001 this is an overlapping sequence then there are 2 sequences if you consider overlapping if not it’s just one. Consider overlapping if possible
Write a C code or a C function and send it along with at least 10 different test cases.
2 / 2
2. A pointer variable can take different addresses ?
The average score is 65%
Exit
WhatsApp us