Professional Documents
Culture Documents
RegNo: 20MIA1126
Slot:L55+L56
Computer Network Essentials
LAB FAT-WinterSem 21-22
a) Write a C/C++ program to demonstrate hamming code error detection and correction
mechanisms.
OUTPUT:
Source code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
scanf("%d", &d);
scanf("%d", &a[i]);
t = pow(2, k) - 1;
if (j == t)
t1[j] = 0;
j++;
t1[j] = a[i];
j++;
h = j;
n = h - d;
int b[n];
m = n - 1;
t = pow(2, k) - 1;
i++;
if (i >= h)
{ break;
if (i >= h)
break;
i++;
if (i >= h)
break;
if (i >= h)
break;
t1[t] = sum % 2;
sum = 0;
scanf("%d", &t2[i]);
sum = 0;
t = pow(2, k) - 1;
i++;
if (i >= h)
break;
if (i >= h)
break;
{
i++;
if (i >= h)
break;
if (i >= h)
break;
b[m] = sum % 2;
sum = 0;
m--;
if (t2[pos - 1] == 0)
t2[pos - 1] = 1;
else
t2[pos - 1] = 0;
b) Perform Default Routing connecting one class B network (185.1.X.X) with another Class B
network (180.1.X.X) using cisco packet tracer.