Question

3. Write a program to find out if the first two bits of an input hex number is 11and will print the first two bits are ones

4- Write a program that will perform the following: Check the first two numbers of an input data if they are 11 and will prin

it's in C programming language

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question 3:

#include <stdio.h>
#include<string.h>

int main()
{
char array[100];
printf("Enter hexadecimal number ");
scanf("%s",array);
int l=strlen(array);
if(array[0]=='1' && array[1]=='1')
{
printf("\nFirst two bits are one ");
}
else
printf("\nFirst two bits are not one ");

return 0;
}

Question 4:

#include <stdio.h>
#include<string.h>

int main()
{
char array[100];
printf("Enter hexadecimal number ");
scanf("%s",array);
int l=strlen(array);
if(array[0]=='1' && array[1]=='1')
{
printf("\nOpen door 1 ");
}
else if(array[l-1]=='1' && array[l-2]=='1')
printf("\nOpen door 2 ");
else
printf("Close all the doors ");

return 0;
}
Enter hexadecimal number 77f11 Open door 2

DON'T FORGET TO HIT LIKE.

THANKS BY HEART.

Add a comment
Know the answer?
Add Answer to:
it's in C programming language 3. Write a program to find out if the first two...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assembly language x86 processors in c++ Suppose the content of ax register is OxAFBB. Write program...

    Assembly language x86 processors in c++ Suppose the content of ax register is OxAFBB. Write program to do the following 16 15 14 13 12 11 10 987 6 5 4 3 2 1 1 1 0 0 a. Count and display the number of ones b. Determine whether the bit number 8 is on or off c. The bits 14,13,12,11 indicates the number of doors open (1011 means 8+2+1-11 doors open). Determine how many doors are open 01 0

  • in c programming language . 10.14 (Reversing the Order of an Integer's Bits) Write a program...

    in c programming language . 10.14 (Reversing the Order of an Integer's Bits) Write a program that reverses the order of the bite! in an unsigned int value. The program should input the value from the user and call function re verseBits to print the bits in reverse order. Print the value in bits both before and after the bits are reversed to confirm that the bits are reversed properly.

  • Answer should be in C programming language Write a program that will create an array of...

    Answer should be in C programming language Write a program that will create an array of 10 floating point numbers and take input 10 floats from keyboard. The program will print the position (index) of the maximum and minimum number among them

  • Question: WRITE A PROGRAM IN LC-3 ASSEMBLY LANGUAGE. DO NOT ... WRITE A PROGRAM IN LC-3...

    Question: WRITE A PROGRAM IN LC-3 ASSEMBLY LANGUAGE. DO NOT ... WRITE A PROGRAM IN LC-3 ASSEMBLY LANGUAGE. DO NOT USE PYTHON, JAVA, C or C++ or OTHERS. Your task is to write a program that counts the number of 1 bits of the value stored at location given by Datal. Your program should print the count (in hexadecimal, as it is easier) along with an appropriate heading. Test your program with the following values stored in Datal: a xFFFE...

  • Write a Program in C language for: 1. Create a C program to read 7 integers...

    Write a Program in C language for: 1. Create a C program to read 7 integers and store them in an array. Next, the program is to check if the array is symmetric, that is if the first element is equal to the last one, the value of the second one is equal to the value of the last but one, and so on. Since the middle element is not compared with another element, this would not affect the symmetry...

  • Programming language is C++. 9. Write a program that reads digits and composes them into integers....

    Programming language is C++. 9. Write a program that reads digits and composes them into integers. For example, 123 is read as the characters 1, 2, and 3. The program should output 123 is 1 hundred and 2 tens and 3 ones. The number should be output as an int value Handle numbers with one, two, three, or four digits. Hint: To get the integer value 5 from the character '5' subtract '0' that is, '5'-'0'

  • Using Atmel studio 7 -C language programming Write a program to find the median of an...

    Using Atmel studio 7 -C language programming Write a program to find the median of an array of 8-bit unsigned integers. When the array has an even number of elements, the median is defined as the average of the middle two elements. Otherwise, it is defined as the middle element of the array. You need to sort the array in order to find the median. SHOW THAT THE CODE IS WORKING PROPERLY IN ATMEL STUDIO 7

  • It is required to write a Matrix Calculator Program using C Programming Language that could only...

    It is required to write a Matrix Calculator Program using C Programming Language that could only perform addition, subtraction, and multiplication of two matrices of appropriate dimensions. Your program should prompt the user to select a matrix operation from a list of options that contains the aforementioned operations. Then, the user should be prompted to enter the dimensions of the two operand matrices. Next, your program should prompt the user to enter the elements of each matrix row-wise. Your program...

  • please write c programming for this code below. Write a program to print a pattern of...

    please write c programming for this code below. Write a program to print a pattern of numbers separated by spaces for the given number of rows. At the time of execution, the program should print the message on the console as: Enter number of rows For example, if the user gives the input as: Enter number of rows : 4 then the program should print the result as: 232 34543 4567654

  • PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv Write a program that generates two random...

    PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv Write a program that generates two random integer numbers between 1 and 100. Then, print out the numbers between the two randomly generated ones using a while loop. The output is shown below. Output: a) start:4, end:14 4 5 6 7 8 9 10 11 12 13 14 b) start:15, end:20 15 16 17 18 19 20

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT