TCS Papers: Sample Questions 392  393 of 502
Examrace Placement Series prepares you for the toughest placement exams to top companies.
Question number: 392
Write in Short
What is fixed size framing?
Explanation

Frames are used as they increase reliability a message packed in one frame would require retransmission of the whole message even on a singlebit error.

Frames can be of fixed or variable size. In fixedsize framing, there is no need for delimiter at boundaries.

Ex: ATM widearea network uses frames of fixed size called cells.
Question number: 393
Describe in Detail
Given the bitwise operators in c
Explanation

In C, following 6 operators are bitwise

& (bitwise AND): Takes two numbers as operands and does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1.

 (bitwise OR): Takes two numbers as operands and does OR on every bit of two numbers. The result of OR is 1 any of the two bits is 1.

^ (bitwise XOR): Takes two numbers as operands and does XOR on every bit of two numbers. The result of XOR is 1 if the two bits are different.

< < (left shift): Takes two numbers, left shifts the bits of the first operand determined by the second operand.

> > (right shift): Takes two numbers, right shifts the bits of the first operand as defined by second operand.

~ (bitwise NOT): Takes one number and inverts all its bits

Example:
#include<stdio.h>
int main()
{
unsigned char x = 7, y = 12;
printf("x = %d, y = %d ", x, y);
printf("x&y = %d ", x&y);
printf("xy = %d ", xy);
printf("x^y = %d ", x^y);
printf("~x = %d ", x = ~x);
printf("y<<1 = %d ", y<<1);
printf("y>>1 = %d ", y>>1);
return 0;
}

Output:
x = 7, y = 12
x&y = 4
xy = 15
x^y = 11
~x = 248
Y < < 1 = 24
y > > 1 = 6