answersLogoWhite

0

#include<stdio.h> #include<conio.h>

int binary(int);

void parity(int [],int []);

int arr[8],arr1[8],parityarr[8];

char chr;

int go,temp,temp1,i;

void main()

{ char chr1;

clrscr();

go=0;

Sender:

if(go==0)

printf("Enter Data : \n");

printf("\nEnter a character : ");

scanf("%c %c",&chr,&chr1);

temp=chr;

binary(temp);

printf("\n\nAscii value is : %d\n",temp);

printf("\nBinary Form : ");

for(i=7;i>=0;i--)

{

arr1[i]=arr[i];

printf("%d ",arr[i]);

}

printf("\n");

temp1=chr1;

binary(temp1);

printf("\n\nAscii value is : %d\n",temp1);

printf("\nBinary Form : ");

for(i=7;i>=0;i--)

{

printf("%d ",arr[i]);

}

parity(arr,arr1);

for(i=7;i>=0;i--)

{

arr[i]=0;

arr1[i]=0;

}

getch();

}

void parity(int arr[],int arr1[])

{

printf("Receiver Side :\n");

printf("\n\nLRC :\n");

for(i=7;i>=0;i--)

{

printf("%d ",arr[i]);

}

printf("\n");

for(i=7;i>=0;i--)

{

printf("%d ",arr1[i]);

}

printf("\n---------------------\n");

for(i=0;i<8;i++)

{

if(arr[i]==0 && arr1[i]==0 arr[i]==1 && arr1[i]==1)

{

parityarr[i]=0;

}

else if(arr[i]==1 && arr1[i]==0 arr[i]==0 && arr1[i]==1)

{

parityarr[i]=1;

}

}

for(i=7;i>=0;i--)

{

printf("%d ",parityarr[i]);

}

}

int binary(int x)

{

int rem;

int ctr=0,i=1;

do

{

rem=x%2;

arr[i]=rem;

if(rem==1)

{

ctr++;

}

x=x/2;

i++;

}

while(x!=0);

if(ctr%2==0)

{

arr[0]=0;

}

else

{

arr[0]=1;

}

return(0);

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Physics

Sound from source A has a frequency twice as great as the frequency of sound from source B compare the wavelengths of sound from two sources?

The formula goes: c = lambda times f where c is the speed in the medium (air) in meters per second lambdathe wavelength in meters and f the frequency in Hz. If the frequency is doubled, the wavelength will be halved.


What kind of wave is sound wave?

Mechanical WaveLongitudinal WavePressure Wavesound wave is a longitudinal mechanical wave.answer: B. compression C. longitudinal D. mechanical


What is the Doppler shift equation?

Percentage(%)=(C+Vr)\(C+Vs) C is the velocity of waves in the medium; Vr is the velocity of the receiver relative to the medium; positive if the receiver is moving towards the source (and negative in the other direction); Vs is the velocity of the source relative to the medium; positive if the source is moving away from the receiver (and negative in the other direction).


What statement is true A. A sustainable energy source is one that will not run out. B. A sustainable energy source is one that does not cost very much. C. A sustainable energy source is one with a hig?

A. A sustainable energy source is one that will not run out. This is because sustainable energy sources like solar, wind, and hydropower are renewable and can be used indefinitely without depleting their source.


The phenomenon that sound wave fails to exhibit is - a Interference b Defraction c Vibration d Polarization?

The phenomenon that sound wave fails to exhibit is polarization.

Related Questions

What is the Source code for longitudinal redundancy check in C language?

It depends on the language you want to use. Here is a VB example:http://bytes.com/topic/visual-basic-net/answers/443023-lrc-calculation-algorithm


What source would provide synonyms for the word humor in order to avoid redundancy in writing?

A thesaurus.


What are sound waves A Standing wave B Transverse wave C Longitudinal wave?

Longitudinal (also called compression) wave


What has the author C Van de Kreeke written?

C. Van de Kreeke has written: 'The interference of the model support mast with measurements of the longitudinal and lateral aerodynamic coefficients' -- subject(s): Lateral Stability of airplanes, Longitudinal Stability of airplanes, Stability of airplanes, Lateral, Stability of airplanes, Longitudinal


What is the use of function in c?

using function we can call the function in the program any where. by using functions we can reduce the code redundancy


What is the differentiate of turbo c from turbo c plus plus?

Turbo C compiles c source. turbo c++ compiles c++ source code.


Can you give me the source code of sales in c language?

You can check various open source sites (SourceForge, etc.) to see if anyone has a program relating to sales, but if it is a proprietary (for sale) program you won't get the source code unless you pay for the source code license.


Getting source code of c?

C is a programming language, so it doesn't have source code.(On the other hand, C compilers do have source code, but you, as a beginner in programming, could not understand them.)


What is the source code for scientific calculator in c?

What is the source code for scientific calculator in c?Read more: What_is_the_source_code_for_scientific_calculator_in_c


How do you Open a text file as C plus plus source code?

All C++ source code is is a text file with the .cpp extension. So if you save your code as *****.cpp then it is automatically C++ source code.


What is built-in redundancy?

redundancy means back up so a built in redundancy in a computer is like a 2nd C: drive in case the first fails it can be switched instantly, also a 2nd power supply to minimize downtime. in a factory this could mean having 2 sets of control boards inside a machine so if one breaks down the other can be used while the broken one is repaired or replaced.


How you can c?

Books are, in my opinion, the best source of info, but because C is losing popularity to C++, the library will probably be the best source for books on C, but there still shuld be some available. Also Google C tutorials.