1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SOVA2 [1]
3 years ago
9

Program for bit stuffing...?

Computers and Technology
1 answer:
Olegator [25]3 years ago
4 0

Answer: Program for bit stuffing in C

#include<stdio.h>

      int main()

    {    

          int i=0,count=0;

          char data[50];

          printf("Enter the Bits: ");

          scanf("%s",data);            //entering the bits ie. 0,1  

          printf("Data Bits Before Bit Stuffing:%s",databits);

          printf("\nData Bits After Bit stuffing :");

          for(i=0; i<strlen(data); i++)

              {

              if(data[i]=='1')

                     count++;

              else

                     count=0;

                printf("%c",data[i]);

             if(count==4)

                {

                          printf("0");

                          count=0;

                 }

             }

    return 0;

 }

Explanation:

bit stuffing is the insertion of non-information bits during transmission of frames between sender and receiver. In the above program we are stuffing 0 bit after 4 consecutive 1's. So to count the number of 1's we have used a count variable. We have used a char array to store the data bits . We use a for loop to iterate through the data bits to stuff a 0 after 4 consecutive 1's.

You might be interested in
Write a for loop to populate array userGuesses with NUM_GUESSES integers. Read integers using cin. Ex: If NUM_GUESSES is 3 and u
vlabodo [156]

Answer:

Follows are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main() //defining main method

{

const int NUM_GUESSES = 3;//defining an integer constant variable NUM_GUESSES

int userGuesses[NUM_GUESSES];//defining an array userGuesses

int i = 0;//defining integer variable i

for(i=0;i<NUM_GUESSES;i++)//defining for loop for input value

{

cin>>userGuesses[i];//input array from the user end  

}

for (i = 0; i < NUM_GUESSES; ++i)//defining for loop fore print value  

{

cout <<userGuesses[i] << " ";//print array value with a space

}

return 0;

}

Output:

9

5

2

9 5 2  

Explanation:

In the above-given program, an integer constant variable NUM_GUESSES is defined that holds an integer value, in the next step, an integer array "userGuesses" is defined, which holds NUM_GUESSES value.

In the next step, two for loop is defined, in the first loop, it is used for an input value, and in the second loop, it prints the array value.    

6 0
3 years ago
I'll pay 50 dollars to anyone who can do this leave your snap after answering doing it and ill cash app it
gladu [14]

Well for must cases it is the Ram of the system and the processor I will show you how you can get rid of slow processing

  1. Run the task manager then try to stop some running programs
  2. the antivirus sometimes slows the computer due to the processing power it takes.
  3. I would recommend that all program should be closed from the task manager and close some running apps in the system settings go to start up and then close it now you are good to go.

5 0
3 years ago
Write a Temperature class that will hold a temperature in Fahrenheit and provide methodsto get the temperature in Fahrenheit, Ce
julsineya [31]

Answer: Thermometer

Explanation:

5 0
4 years ago
A chief Information Security Officer (CISO) is performing a BIA for the organization in case of a natural disaster. Which of the
nataly862011 [7]

Answer:

The correct answer is option (D) Identify the impact on safety of the property

Explanation:

Solution

In every Business Impact Analysis, the first and the most important step is for the CISO is to identify and estimate the impact of the aftereffects on the business and property of an organization that may be occurred from the disaster.

Physical security is very important, but it is not noticed by most organizations. It is important if you do not want anyone to take  away your information or destroy it, in case of natural calamity. the reason could be that, the intruder is  doing it for his personal achievement, financial gain,or seeking revenge or when one is taken unaware and becomes a target. If this security is not maintained properly all the safety measures will not be useful once the attacker gets through by gaining physical access.

Example of property can be software, equipment, facilities, company’s assets.

4 0
3 years ago
What is the name for non-paid active links returned by an Internet search engine in the search results?
otez555 [7]

Answer:

organic links

Explanation:

7 0
3 years ago
Other questions:
  • Which of the following is an encryption tool that allows users to encrypt files and folders by simply right-clicking a given obj
    8·1 answer
  • What are operational databases
    12·1 answer
  • Write a function "nonRepeatings" that takes a string "s3" and returns the non-repeating characters in this string. Sample Input
    11·1 answer
  • What is the function of control unit? in computer. <br>​
    8·1 answer
  • Which among the following choices is correct based on the two statements listed below? Statement 1: When the lexical analyzer sc
    12·1 answer
  • A new school is being built in the local school district.It will have three computer labs with 28 computers each. There will be
    13·1 answer
  • Need answer ASAP
    14·1 answer
  • Decomposition is
    5·1 answer
  • A program that converts a program to binary all at once and runs the entire program when finished with the conversion.
    5·1 answer
  • Founder of television and Radio​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!