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
Which of the following could be true of two diffrent speicies that have competitieve realtionship in the same ecosytem?
chubhunter [2.5K]

they both an enemy that is the same but they also have a same niche so the have the same niche

6 0
3 years ago
A series of events that gets the computer ready for work is known as what?
DedPeter [7]
I think the answer is the third one...
7 0
4 years ago
Read 2 more answers
One reason for using social media is to develop social and professional contacts. True or false?
xxMikexx [17]
I would say this answer is true.
7 0
3 years ago
Read 2 more answers
8085 microprocessor​
ohaa [14]

do you want us to write something about it or??

5 0
4 years ago
Write a program whose inputs are two integers, and whose output is the smallest of the two values.
andrezito [222]

Method 1 :

Using If else statements: If the condition checks whether num1 is smaller than num2 if so it will print 'Smallest of these two integers is num1'.

else it will print 'Smallest of these two integers is num2'

Method 2:

Using the 'min' method: using the method min(num1,num2), the program finds the smallest value and prints it directly to the user.

Python Program using method 1

#PYTHON PROGRAM TO FIND SMALLEST INTEGER VALUE FROM TWO INPUTS FROM USER - Method 1

#Accepts inputs from user

num1 = int (input ("Enter your first number:")) #Gets the first integer input from user and stores in num1

num2 = int (input ("Enter your second number: ")) #Gets the second integer input from user and stores in num2

#Finding output by if else

#Checks num1 smaller than num2

if (num1 < num2):

#assign num1 to small

small = num1

else:

#assign num2 to small

small = num2

 

print ("Smallest of these two integers is", small)

Python Program using method 2

#PYTHON PROGRAM TO FIND SMALLEST INTEGER VALUE FROM TWO INPUTS FROM USER - Method 2

#Accepts inputs from user

num1 = int (input ("Enter your first number:")) #Gets the first integer input from user and stores in num1

num2 = int (input ("Enter your second number: ")) #Gets the second integer input from user and stores in num2

#Finding output using min method

print("\n Smallest of these two integers is",min(num1,num2)) #Prints output to user

8 0
2 years ago
Other questions:
  • What button is marked with the little hollow square at the top of the right window
    7·2 answers
  • Which is a network of devices built around a person, typically within 10 meters of range?
    5·1 answer
  • Plese give three examples of specilized servers.
    13·2 answers
  • You accidentally moved your task bar from the bottom of the screen to the left side. You would like to
    14·2 answers
  • Briefly describe the software quality dilemma in your own words
    13·1 answer
  • To all paladins players out there!!!!!
    14·1 answer
  • PLZZZZ HELP!!!
    12·2 answers
  • Which type of word processing programs enables users to include illustrations within the program?
    10·2 answers
  • +<br>ii) MnO4 + H2S + H+​
    9·1 answer
  • Which directory stores the cron configuration file?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!