C

Implementation of Hamming Code

Write a C program to Implement Hamming Code. #include<stdio.h> #include<conio.h> void main() { int data[7],rec[7],i,c1,c2,c3,c; printf(“this works for message of 4bits in size \n enter message bit one by one: “); scanf(“%d%d%d%d”,&data[0],&data[1],&data[2],&data[4]); data[6]=data[0]^data[2]^data[4]; data[5]=data[0]^data[1]^data[4]; data[3]=data[0]^data[1]^data[2]; ...
C

Convert temperature from degree centigrade to Fahrenheit

Write a C program to convert temperature from degrees Centigrade to Fahrenheit. #include<stdio.h> int main() { float celsius, fahrenheit; printf(“\nEnter temp in Celsius : “); scanf(“%f”, &celsius); fahrenheit = (1.8 * celsius) + 32; printf(“\nTemperature in Fahrenheit : %f “, fahrenheit); return (0); } Output: Enter temp in Celsius: 32 The temperature ...