What is the range of numbers that can be assigned to a variable declared as an unsigned integer?
A 1-byte unsigned integer has a range of 0 to 255. Compare this to the 1-byte signed integer range of -128 to 127. Both can store 256 different values, but signed integers use half of their range for negative numbers, whereas unsigned integers can store positive numbers that are twice as large.
Determine the hierarchy of operations and evaluate the following expression:
i = 2 * 3 / 4 + 4 / 4 + 8 - 2 + 5 / 8
Stepwise evaluation of this expression is shown below:
i = 2 * 3 / 4 + 4 / 4 + 8 - 2 + 5 / 8
i = 6 / 4 + 4 / 4 + 8 - 2 + 5 / 8 operation: *
i = 1 + 4 / 4 + 8 - 2 + 5 / 8 operation: /
i = 1 + 1+ 8 - 2 + 5 / 8 operation: /
i = 1 + 1 + 8 - 2 + 0 operation: /
i = 2 + 8 - 2 + 0 operation: +
i = 10 - 2 + 0 operation: +
i = 8 + 0 operation : -
i = 8 operation: +
Note that 6 / 4 gives 1 and not 1.5. This so happens because 6 and 4 both are integers and therefore would evaluate to only an integer constant. Similarly, 5 / 8 evaluates to zero, since 5 and 8 are integer constants and hence must return an integer value.
How is a system call different from a function call?
- A system call is a call to a subroutine built into the system, while a function call is a call to a subroutine within the program.
- Unlike function calls, system calls are used when a program needs to perform some task, which it does not have privilege for.
- System calls are entry points into the operating system kernel and are not linked to the program (like function calls).
- Unlike, system calls, function calls are portable.
- The time overhead of a system call is more than the overhead for a function call because a transition between the user mode and the kernel mode must take place.
- System calls are executed in kernel address space, while function calls are executed in user address space.
What is meant by a protocol in computer communication?
Protocol, in computer science, is a set of rules or procedures for transmitting data between electronic devices, such as computers. In order for computers to exchange information, there must be a preexisting agreement as to how the information will be structured and how each side will send and receive it. Without a protocol, a transmitting computer, for example, could be sending its data in 8-bit packets while the receiving computer might expect the data in 16-bit packets.
How much time will be required to transmit 100 K bits of data over a 100 Mbps line?
1 Mbps = 10⁶ bits/s = 1000 x 1000 bits/second
1 KB = 1024 bytes = 1024 x 8 bits
Hence time of data trasfer
= (1024 x 8)/(1000 x 1000)
= 0.008 sec
= 0.01 sec.
Why is it necessary to normalise the database tables?
It is important that a database is normalized to minimize redundancy (duplicate data) and to ensure only related data is stored in each table. It also prevents any issues stemming from database modifications such as insertions, deletions, and updates.
How many RAM chips of size 256 KB are required to realise a 1 MB memory?
1 MB = 1024 KB = (1024 x 8) Kbits
(as 1 byte = 8 bits i.e. 1 B = 8 b)
256 KB = 256 x 8 Kbits
= (1024 x 8)/(256 x 8)
What output will the following code generate?
int ***r, **q, *p, i=8;
p = &i;
q = &p;
r = &q;
printf("%d, %d, %d\n", *p, **q, ***r);
8, 8, 8
What is meant by BIOS?
As your PC’s most important startup program, BIOS, or Basic Input/Output System, is the built-in core processor software responsible for booting up your system.
What is the full form of SMTP? For what application is it used?
The Simple Mail Transfer Protocol (SMTP) is an internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages.
The study material for AMIE/B Tech/Junior Engineer exams is available at https://amiestudycircle.com