Write a C program, final_q1.c, which reads two integers andprints all the integers between the twointegers which
Question:
Write a C program, final_q1.c, which reads two integers andprints all the integers between the twointegers which have their bottom 2 bits set.
Only print integers between the two integers, the two integersthemselves should not be printed.
Reminder: a bit is said to be set if it isa 1, and unset if it is a 0.
So:
19, whichis 10011 inbinary, has its bottom 2 bits set.
21, whichis 10101 in binary, does nothave its bottom 2 bits set.
For example:
./final_q1315711./final_q146./final_q150705155596367./final_q1244227313539
You can use make to build your code:
make final_q1
Your program can assume its inputonly contains only 2 integers, one per line.
Your program can assume the firstinteger is not greater than the second integer.
Your program can assume that bothintegers will fit in a C int variable.
Your solution must bein C only.
Your solution must not bein MIPS, C++, Python, orany other language.Your program cannot call externalprogram.
Your program cannot use anyof: fork(), exec(), posix_spawn(), system(), orany other similar functions.No error checking is necessary orrequired.
// read two integers and print all the integers which have theirbottom 2 bits set.
int main(void) {
int x, y;
scanf("%d", &x);
scanf("%d", &y);
// PUT YOUR CODE HERE
return 0;
}
Introduction to Operations Research
ISBN: 978-1259162985
10th edition
Authors: Frederick S. Hillier, Gerald J. Lieberman