Tag: technology

Questions Related to technology

17 How do I `lock' a file?

  1. 1 Use filelock()

  2. 2 use lockfile()

  3. 3 Use lockfd()

  4. 4 use fcntl()


Correct Option: D

18 How do I find the size of a file inside a program?

  1. 1 Use ls -l

  2. 2 Use sizeof()

  3. 3 Use filesize()

  4. 4 Use fstat()


Correct Option: D
  1. 1 Use getmemory()

  2. 2 Use sysctl()

  3. 3 Use freemem()

  4. 4 Use malloc()


Correct Option: B
  1. 1 A port to connect printer 2

  2. A port to connect keyboard

  3. 3 An abstraction to pass data across processes

  4. 4 A hardware device


Correct Option: C
  1. 1 A mechanism to share non-sharable resources

  2. 2 A mechanism to access memory very fast

  3. 3 A mechanism to access kernel details

  4. 4 None


Correct Option: A

23 What is a message queue?

  1. 1 A printer queue

  2. 2 An IPC mechanism with destructive execute

  3. 3 An IPC mechanism with destructive write

  4. 4 An IPC mechanism with destructive read


Correct Option: D
  1. No differences

  2. 2 IPC mechanism vs Non-IPC mechanism

  3. 3 Non-destructive read vs destructive read

  4. 4 Destructive read vs non-destructive read


Correct Option: C
  1. 1 sed 's/ */$//' test1

  2. 2 sed 's/ *$//' test1

  3. 3 sed 's/ *$//' test1

  4. 4 sed 's/ *$\/\/' test1


Correct Option: B

How many bytes will a S9(8) COMP field occupy ?

  1. 9

  2. 4

  3. 8

  4. 5


Correct Option: B

AI Explanation

To answer this question, we need to understand the concept of the COMP field in COBOL.

In COBOL, the COMP field is used to represent numeric data. It is stored in binary format, which means that each digit is represented by a binary byte.

The S9(8) COMP field is defined as a signed numeric field with a length of 8 digits. The "S9" part indicates that it is a signed field, and the "(8)" part indicates the length.

Since each digit is represented by a binary byte, the S9(8) COMP field will occupy 8 bytes.

Therefore, the correct answer is B) 4.