PRACTICAL SET 1>> AIM-->. TO STUDY DIFFERENT TYPES OF TOPOLOGIES AND IMPLEMENT IN CISCO PACKET TRACER: ANS---> 1>> BUS TOPOLOGY 2>> STAR TOPOLOGY 3>> RING TOPOLOGY 4>> MESH TOPOLOGY 5>> TREE TOPOLOGY 6>> HYBRID TOPOLOGY PRACTICAL SET 2 >>. NO NEED TO WRITE PRACTICAL SET 3 >>. NO NEED TO WRITE PRACTICAL SET 4 >>. NO NEED TO WRITE PRACTICAL SET 5>> AIM--> WRITE A PROGRAM TO IMPLEMENT HAMMING CODE C- PRACTICAL CODE : #include <stdio.h> // Encoding Function for (7,4) Hamming Code void hamming_encode(int data, int *codeword) { // Ensure the input data is a 4-bit value (0-15) if (data < 0 || data > 15) { printf("Input data must be a 4-bit value between 0 and 15.\n"); return; } // Initialize the parity bits int p1 = (data & 1) ^ ((data >> 1) & 1) ^ ((data >> 3) & 1); int p2 = (data & 1) ^ ((data >> 2) &
PYTHON ASSIGNMENT – 5 1>What is string concatenation? Explain different ways to concatenate strings. ANS>> String concatenation is the process of combining two or more strings into a single string. In programming, it is a commonly used operation for manipulating text data. There are different ways to concatenate strings depending on the programming language or framework being used. Here are some examples: Using the plus (+) operator: In many programming languages, the simplest way to concatenate strings is by using the plus (+) operator. This is also known as the concatenation operator. Here's an example in Python: string1 = "Hello" string2 = "World" result = string1 + " " + string2 print(result) OUTPUT: Hello World 2.Using the join() method: Another way to concatenate strings is by using the join() method. This method takes an iterable (such as a list or tuple) of strings as an argument and concatenates them with a separator string. Here