Technical Questions

Q:

What is the output of this C code?

       #include <stdio.h>
        void main()
        {
            int x = 1, z = 3;
            int y = x << 3;
            printf( "%dn", y );
        }

A) -2147483648 B) -1
C) Run time error D) 8
 
Answer & Explanation Answer: D) 8

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Programming

2 19750
Q:

What are the typical elements of a process image?

Answer

User data: Modifiable part of user space. May include program data, user stack area, and programs that may be modified.


User program: The instructions to be executed.


System Stack: Each process has one or more LIFO stacks associated with it. Used to store parameters and calling addresses for procedure and system calls.


Process control Block (PCB): Info needed by the OS to control processes.

Report Error

View answer Workspace Report Error Discuss

14 18993
Q:

What will output when you compile and run the following code?

#include <stdio.h>
struct student
{

int roll;
int cgpa;
int sgpa[8];

};

void main()
{

struct student s = { 12,8,7,2,5,9 };
int *ptr;
ptr = (int *)&s;
clrscr();
printf( "%d", *(ptr+3) );
getch();

}

A) 8 B) 7
C) 2 D) Compiler error
 
Answer & Explanation Answer: C) 2

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Programming

1 18811
Q:

If no multivalued attributes exist and no partial dependencies exist in a relation, then the relation is in what normal form?

A) First normal form B) Second normal form
C) Third normal form D) Fourth normal form
 
Answer & Explanation Answer: B) Second normal form

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

16 18281
Q:

Unreachable code would best be found using

A) code inspections B) a static analysis tool
C) code reviews D) a test management tool
 
Answer & Explanation Answer: C) code reviews

Explanation:

Code review is a software quality assurance activity in which one or several humans check a program mainly by viewing and reading parts of its source code, and they do so after implementation or as an interruption of implementation.

Report Error

View Answer Report Error Discuss

14 17969
Q:

What will be output of following program ?

#include
int main()

{

int a = 10;
void *p = &a;
int *ptr = p;
printf("%u",*ptr);
return 0;

}

A) 10 B) Address
C) 2 D) Compilation error
 
Answer & Explanation Answer: A) 10

Explanation:

Void pointer can hold address of any data type without type casting. Any pointer can hold void pointer without type casting.

Report Error

View Answer Report Error Discuss

Filed Under: Programming

1 17789
Q:

 For what purposes are views used?

A) To hide rows only B) To hide columns only
C) To hide complicated SQL statements only D) All of the above are uses for SQL views.
 
Answer & Explanation Answer: D) All of the above are uses for SQL views.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

13 17732
Q:

What resources are used when a thread is created? How do they differ from those when a process is created?

Answer

When a thread is created the threads does not require any new resources to execute the thread shares the resources like memory of the process to which they belong to. The benefit of code sharing is that it allows an application to have several different threads of activity all within the same address space. Whereas if a new process creation is very heavyweight because it always requires new address space to be created and even if they share the memory then the inter process communication is expensive when compared to the communication between the threads.

Report Error

View answer Workspace Report Error Discuss

20 17592