Arrange the following data types available in C language according to their size (smallest to largest):
A. signed long int
B. long double
C. unsigned char
D. unsigned int
Choose the correct answer from the options given below:
Step 1: Understand the size of data types in C.
In C, the sizes of data types depend on the system architecture, but typically:
- **unsigned char** is the smallest data type, usually 1 byte.
- **unsigned int** typically takes 4 bytes on most systems.
- **signed long int** usually takes 4 bytes, but can take 8 bytes on some systems.
- **long double** is the largest, often taking 8 or 10 bytes depending on the system.
Step 2: Evaluate the options.
- **C (unsigned char)** is the smallest, so it comes first.
- **D (unsigned int)** is next in size, typically taking 4 bytes.
- **A (signed long int)** comes next, typically taking 4 or 8 bytes.
- **B (long double)** is the largest data type in C, typically taking 8 or 10 bytes.
Step 3: Conclusion.
Thus, the correct order from smallest to largest is: **C, D, A, B**.
What is the output of the following code fragment?
int x = 24;}
printf("%d\n", x);
printf("%3d %3d\n", x, x);}
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into the I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is _________ (Answer in integer).
Consider the following C program
The value printed by the given C program is _________ (Answer in integer).
Match the following layers with their corresponding functionalities:
\[ \begin{array}{|c|c|} \hline \textbf{Layer} & \textbf{Functionality} \\ \hline \text{Networking Layer} & \text{Data packet transfer} \\ \text{Transport Layer} & \text{Host-to-host communication} \\ \text{Data Link Layer} & \text{Error detection and correction} \\ \hline \end{array} \]Match List-I with List-II and choose the correct answer:
Match List-I with List-II:
Who said this sentence –
Match List-I with List-II and choose the correct answer:
Match List-I with List-II and choose the correct answer: