Technical Questions

Q:

What value does read() return when it has reached the end of a file?

A) 1 B) -1
C) 0 D) None
 
Answer & Explanation Answer: B) -1

Explanation:

It returns -1

Report Error

View Answer Report Error Discuss

Filed Under: Programming

1 3102
Q:

What is schema?

Answer

The description of a data base is called the database schema , which is specified during database design and is not expected to change frequently . A displayed schema is called schema diagram .We call each object in the schema as schema construct.

Report Error

View answer Workspace Report Error Discuss

Subject: Database
Job Role: Database Administration

0 3099
Q:

If the following structure is written to a file using fwrite(), can fread() read it back successfully?

struct emp

{

    char *n;

    int age;

};

struct emp e = { "Sujay",15};

FILE *fp;

fwrite (&e, sizeof (e), 1, fp);

Answer

No, since the structure contains a char pointer while writing the structure to the disk using fwrite() only the value stored in the pointer n would get written. When this structure is read back the address would be read back but it is quite unlikely that the desired string would be present at this address in memory

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 3096
Q:

What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices?

Answer

Kernel follows Round Robin scheme choosing a swap device among the multiple swap devices in Unix System V.

Report Error

View answer Workspace Report Error Discuss

Subject: Operating Systems Exam Prep: GATE

8 3088
Q:

Where is a hub specified in the OSI model?

A) Physical Layer B) Data Link Layer
C) Application Layer D) Session Layer
 
Answer & Explanation Answer: A) Physical Layer

Explanation:

Hubs regenerate electrical signals, which are specified at the Physical layer.

Report Error

View Answer Report Error Discuss

Filed Under: Networking
Exam Prep: CAT
Job Role: Analyst , Network Engineer

1 3075
Q:

Point out the error, if any, in the following program.

# include "stdio.h"

main()

{

     FILE *fp;

     char str[80];

     fp = fopen ("trail", "r");

     while (!feof (fp))

    {

           fgets (str, 80, fp);

           puts (str);

     }

     fclose (fp);

}

Answer

The last line from the file "trial" would be read twice. To avoid this, ues:


       While ( fgets (str, 80, fp) ! = NULL)


               puts (str);

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 3068
Q:

How do you detect if two 8-bit signals are same?

Answer

Pass input to XOR and give their outputs to OR gate, if your output is 0 both 8-bit signals are same.


OR


Pass input to XNOR and give their outputs to AND gate, if your output is 1 both 8-bit signals are same. 

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

1 3057
Q:

Database is a collection of concepts that can be used to describe the structure of a database

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

Database provides necessary means to achieve this abstraction. By structure of a database we mean the data types, relations, and constraints that should hold on the data.

Report Error

View Answer Workspace Report Error Discuss

Subject: Database
Job Role: Database Administration

0 3055