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
How much cell phone data does the average person use a month
azamat
It all depends on what you're doing online.
7 0
3 years ago
What sentence could Lou’s granddaughter not answer? Explain the context and discuss whether you could answer this question or no
Tanya [424]
He wouldn’t answer the context for the discussion
7 0
2 years ago
What will you recommend to HP Mini 5103 Notebook?​
laiz [17]
Hey what are you guys going on with your dad today or tomorrow night
5 0
3 years ago
Which type of packet is sent by a dhcp server after receiving a dhcp discover message?
emmasim [6.3K]
A<span> DHCPOffer packet is sent to the client.</span>
5 0
3 years ago
Characteristics of a cohesive group include all of the following EXCEPT: a. ​support b. a lack of bonding c. mutuality within th
Brilliant_brown [7]

Answer:

Option B i.e., a lack of bonding is the correct answer.

Explanation:

Cohesion is defined as the ability to work in a group, so many time the following situation or problems that are lack of bonding occurs between the mates or the group members because while they achieving their goals there is the understanding problem may occur between them or sometime their ideas should be a mismatch.

4 0
3 years ago
Other questions:
  • A portable electronic device that can be used in an emergency to stop someone’s heart from going out of rhythm is called a/an
    6·2 answers
  • I have an LG phone. Since I just bought my phone, my bill to text message isn't paid yet. I texted a couple of things playfully
    5·2 answers
  • Buenas , ayudenme con esta tarea de excel 2016
    6·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • In needs analysis: Group of answer choices the costs of different physical network design alternatives are assessed the rate of
    10·1 answer
  • Create a program which reads in CSV data of Creatures and loads them into aHash Map. The key of this hash map will be the name o
    10·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • MyProgramming Lab
    5·1 answer
  • What do you understand by cloud computing? list the advantages of clould computing.​
    13·2 answers
  • Identify the names of the following:<br><br>Please help me.​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!