Monday 31 October 2011

Where in memory are my variables stored?

Variables can be stored in several places in memory, depending on their lifetime. Variables that are defined outside any function (whether of global or file static scope), and variables that are defined inside a function as static variables, exist for the lifetime of the program’s execution. These variables are stored in the “data segment.” The data segment is a fixed-size area in memory set aside for these variables. The data segment is subdivided into two parts,

Variables and Data Storage

One of the C language’s strengths is its flexibility in defining data storage. There are two aspects that can be controlled in C: scope and lifetime. Scope refers to the places in the code from which the variable can be accessed. Lifetime refers to the points in time at which the variable can be accessed.

Three scopes are available to the programmer:

extern:


This is the default for variables declared outside any function. The scope of variables with extern scope is all the code in the entire program.


static:

Sun Certified Java Programmer (SCJP)

What will be the result of an attempt to compile and run the following program?


class Box
{

int b,w;
void Box(int b,int w)
{


this.b = b;
this.w = w;


}


}

public class MyBox extends Box
{

MyBox()
{


super(10,15);
System.out.println(b + "," + w);


}


static public void main(String args[])
{


MyBox box = new MyBox();


}


}

Choices:

A. Does not compile; main method is not declared correctly
B. Prints 10,15
C. Prints 0,0
D. None of the above

Correct choice:

  • D


Explanation:

Sun Certified Java Programmer (SCJP)

Constructors


A constructor is used when creating an object from a class. The constructor name must match the name of the class and must not have a return type. They can be overloaded, but they are not inherited by subclasses.

Invoking constructors


A constructor can be invoked only from other constructors. To invoke a constructor in the same class, invoke the this() function with

Sunday 30 October 2011

Predict the output or error(s) for the following:

#define int char

main()

{

            int i=65;

            printf("sizeof(i)=%d",sizeof(i));

}

Answer:

sizeof(i)=1

Explanation:

Predict the output or error(s) for the following:

main()

{

int c=- -2;


printf("c=%d",c);


}

Answer:

c=2;

Explanation:

Here unary minus (or negation) operator is used twice. Same maths

Saturday 29 October 2011

What are short-, long- and medium-term scheduling?

Long term scheduler determines which programs are admitted to the system for processing. It controls the degree of multiprogramming. Once admitted, a job becomes a process.

Medium term scheduling is part of the swapping function. This relates to processes that are in a blocked or suspended state. They are swapped

Friday 28 October 2011

What does the modulus operator do?

The modulus operator (%) gives the remainder of two divided numbers. For instance, consider the following portion of code:

x = 15/7

If x were an integer, the resulting value of x would be 2. However, consider what would happen if you were to apply the modulus operator to the same equation:

x = 15%7

The result of this expression would be the remainder of 15 divided by

What is the difference between ++var and var++?

The ++ operator is called the increment operator. When the operator is placed before the variable (++var), the variable is incremented by 1 before it is used in the expression. When the operator is placed after the
variable (var++), the expression is evaluated, and then the variable is incremented by 1. The same holds true for the decrement operator (--). When the operator is placed before the variable, you are said to

Is left-to-right or right-to-left order guaranteed for operator precedence?

The simple answer to this question is neither. The C language does not always evaluate left-to-right or right-to-left. Generally, function calls are evaluated first, followed by complex expressions and then simple expressions. Additionally, most of today’s popular C compilers often rearrange the order in which the expression is evaluated in order to get better optimized code. You therefore should always

A binary tree with 20 nodes has ____ null branches?

Ans: 21

Let us take a tree with 5 nodes (n=5)

It will have only 6 (ie,5+1) null branches. In general,

            A binary tree with n nodes has exactly n+1 null nodes.

Sorting is not possible by using which of the following methods?


  1. Insertion

  2. Selection

  3. Exchange

  4. Deletion


Ans: Deletion

Using insertion we can perform insertion sort, using selection we can perform selection sort, using exchange we can perform the bubble sort (and other similar sorting methods). But no sorting method can be done just using deletion.

What is the data structures used to perform recursion?

Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls.

Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.

If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.

Sun Certified Java Programmer (SCJP)

Declaring classes, variables, and methods


Now let's look at ways we can modify classes, methods, and variables. There are two kinds of modifiers -- access modifiers and non-access modifiers. The access modifiers allow us to restrict access or provide more access to our code.

Class modifiers


The access modifiers available are public, private, and protected. However, a top-level class can have only public and default access levels. If no access modifier is specified, the class will have default access. Only classes within the same package can see a class with

Thursday 27 October 2011

Sun Certified Java Programmer (SCJP)

Declarations and access control


Arrays


Arrays are dynamically created objects in Java code. An array can hold a number of variables of the same type. The variables can be primitives or object references; an array can even contain other arrays.

Declaring array variables


When we declare an array variable, the code creates a variable that can hold the reference to an array object. It does not create the array object or allocate space for array elements. It is illegal to specify the

Sun Certified Java Programmer (SCJP)

The SCJP exam is the first in a series of Java certification exams offered by Sun Microsystems, and for many programmers it is the first step to becoming established as a competent Java developer.

The exam tests the knowledge of Java fundamentals and requires in-depth knowledge of the syntax and semantics of the language. Even experienced Java programmers can benefit from preparing for the SCJP exam. You get to learn very subtle and useful tips you might not have been aware of, even after many years of Java programming.

What are different types of JIT ?

Note :- This question can only be asked when the interviewer does not know what he wants. It was asked to me in one of interview and for 15 minutes he was roaming around the same question in order to get answer from me (requirement was for a simple database project). Beware of such companies and interviewers you can land up no where.


JIT compiler is a part of the runtime execution environment.

In Microsoft .NET there are three types of JIT compilers:

What is reflection?

All .NET assemblies have metadata information stored about the types defined in modules. This metadata information can be accessed by mechanism called as “Reflection”.System. Reflection can be used to browse through the metadata information.

Using reflection you can also dynamically invoke methods using System.Type.Invokemember. Below is sample source code if needed

Tuesday 25 October 2011

Predict the output or error(s) for the following:

main()

{

            char string[]="Hello World";

            display(string);

}

void display(char *string)

{

printf("%s",string);

}

Answer:

Compiler Error : Type mismatch in redeclaration of function display

Explanation :

Predict the output or error(s) for the following:

 main()

{

              printf("%x",-1<<4);

}

Answer:

fff0

Explanation :

What is an rvalue?

In the previous post, an lvalue was defined as an expression to which a value can be assigned. It was also explained that an lvalue appears on the left side of an assignment statement. Therefore, an rvalue can be defined as an expression that can be assigned to an lvalue. The rvalue appears on the right side of an assignment statement.
Unlike an lvalue, an rvalue can be a constant or an expression, as

Can an array be an lvalue?

In the last post, an lvalue was defined as an expression to which a value can be assigned. Is an array an expression to which we can assign a value? The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal:

int x[5], y[5];
x = y;

You could, however, use a for loop to iterate through each element of

Sunday 23 October 2011

Predict the output or error(s) for the following:

 main()

{

int i=3;


            switch(i)


             {


                default:printf("zero");


                case 1: printf("one");


                           break;


               case 2:printf("two");


                          break;


              case 3: printf("three");


                          break;


              } 


}

Answer :

three

Explanation :

Predict the output or error(s) for the following:

main()

{

char *p;


printf("%d %d ",sizeof(*p),sizeof(p));


}

Answer:

1 2

Explanation:

The sizeof() operator gives the number of bytes taken by its operand. P is a character pointer,

Can we force garbage collector to run ?

System.GC.Collect() forces garbage collector to run. This is not recommended but can be used if situations arises.

What is garbage collection?

Garbage collection is a CLR feature which automatically manages memory. Programmers forget to release the objects while coding ..... Laziness (Remember in VB6 where one of the good practices is to set object to nothing). CLR automatically releases objects when they are no longer in use and refernced. CLR runs on non-deterministic to see the unused objects and cleans them. One side effect of this non-deterministic feature is that we cannot assume an object is

What is Delay signing ?

During development process you will need strong name keys to be exposed to developer which is not a good practice from security aspect point of view.In such situations you can assign the key later on and during development you can use delay signing

Following is process to delay sign an assembly:

  • First obtain your string name keys using SN.EXE.

  • Annotate the source code for the assembly with two custom attributes from System.Reflection: AssemblyKeyFileAttribute, which passes the name of the file

How to add and remove an assembly from GAC?

There are two ways to install .NET assembly in GAC:-

  • Using Microsoft Installer Package. You can get download of installer from http://www.microsoft.com.

  • Using Gacutil. Goto “Visual Studio Command Prompt” and type “gacutil –i (assembly_name)”, where (assembly_name) is the DLL name of the project.


 

What is the concept of strong names?

How do we generate strong names ?

What is the use of SN.EXE ?

How do we apply strong names to assembly?

How do you sign an assembly?

Strong name is similar to GUID(It is supposed to be unique in space and time) in COM components.Strong Name is only needed when we need to deploy assembly in GAC. Strong Names helps GAC to differentiate between two versions. Strong names use public key

Saturday 22 October 2011

What is an lvalue?

An lvalue is an expression to which a value can be assigned. The lvalue expression is located on the left side of an assignment statement, whereas an rvalue is located on the right side of an assignment statement. Each assignment statement must have an lvalue and an rvalue. The lvalue expression must reference a storable variable in memory. It cannot be a constant. For instance,

Predict the output or error(s) for the following:

main()

{

            int i=-1,j=-1,k=0,l=2,m;

            m=i++&&j++&&k++||l++;

            printf("%d %d %d %d %d",i,j,k,l,m);

}

Answer:

0 0 1 3 1

Explanation :

Logical operations always give a result of 1 or 0 . And also the logical AND (&&) operator has higher priority over the logical OR (||)

Predict the output or error(s) for the following:

 main()

{

            extern int i;

            i=20;

           printf("%d",i);

}

 Answer:

Linker Error : Undefined symbol '_i'

Explanation:

extern storage class in the following declaration,

extern int i;

specifies to the compiler that the memory for i is allocated in some

Friday 21 October 2011

What is a binary semaphore? What is its use?

A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes.

Explain Belady's Anomaly.

Also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process' virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady's Anomaly. This is true for certain page reference patterns.

Explain the concept of Reentrancy.

It is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant Procedure is one in which multiple users can share a single copy of a program during the same period. Reentrancy has 2 key aspects: The program code cannot modify itself, and the local data for each user process must be stored separately. Thus, the permanent part is the code, and the temporary part is the pointer back to the calling program and local variables used by that

What is GAC in DotNet?

What are situations when you register .NET assembly in GAC ?

GAC (Global Assembly Cache) is used where shared .NET assembly reside. GAC is used in the following situations :-

  • If the application has to be shared among several application.

  • If the assembly has some special security requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly the

Is versioning applicable to private assemblies?

Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in their individual folders.

Where is version information stored of an assembly ?

Version information is stored in assembly in manifest.

What is Manifest in .Net?

Assembly metadata is stored in Manifest. Manifest contains all the metadata needed to do the following things

  • Version of assembly

  • Security identity

  • Scope of the assembly

  • Resolve references to resources and classes.

  • The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a stand-alone PE file that contains only assembly manifest information.


 

Thursday 20 October 2011

What is the difference between goto and longjmp()and setjmp()?

A goto statement implements a local jump of program execution, and the longjmp() and setjmp() functions implement a nonlocal, or far, jump of program execution. Generally, a jump in execution of any kind should be avoided because it is not considered good programming practice to use such statements as goto and longjmp in your program.

A goto statement simply bypasses code in your program and jumps to a predefined position. To use the goto statement, you give it a

How can you tell whether a loop ended prematurely?

Generally, loops are dependent on one or more variables. Your program can check those variables outside the loop to ensure that the loop executed properly. For instance, consider the following example:

#define REQUESTED_BLOCKS 512
int x;
char* cp[REQUESTED_BLOCKS];


/* Attempt (in vain, I must add...) to
allocate 512 10KB blocks in memory. */


for (x=0; x< REQUESTED_BLOCKS; x++)
{
cp[x] = (char*) malloc(10000, 1);

Predict the output or error(s) for the following:

main()

{

int c[ ]={2.8,3.4,4,6.7,5};


             int j,*p=c,*q=c;


             for(j=0;j<5;j++) {


                        printf(" %d ",*c);


                        ++q;     }


             for(j=0;j<5;j++){


                       printf(" %d ",*p);


                       ++p;     }


}

Answer:

2 2 2 2 2 2 3 4 6 5

Explanation:

Does PL/SQL support "overloading"? Explain

The concept of overloading in PL/SQL relates to the idea that you can define procedures and functions with the same name. PL/SQL does not look only at the referenced name, however, to resolve a procedure or function call. The count and data types of formal parameters are also considered.

PL/SQL also attempts to resolve any procedure or function calls in locally defined packages before looking at globally defined packages or

What are the different type of networking / internetworking devices?

Repeater:

Also called a regenerator, it is an electronic device that operates only at physical layer. It receives the signal in the network before it becomes weak, regenerates the original bit pattern and puts the refreshed copy back in to the link.

Bridges:

These operate both in the physical and data link layers of LANs of same type. They divide a larger network in to smaller segments. They contain logic that allow them to keep the traffic for each

If you want to view a Assembly how do you go about it ?

What is ILDASM ?

When it comes to understanding of internals nothing can beat ILDASM. ILDASM basically converts the whole exe or dll in to IL code. To run ILDASM you have to go to "C:\Program Files\MicrosoftVisual Studio .NET 2008\SDK\v1.1\Bin". Note that i had v1.1 you have to probably change it depending on the type of framework version you have.

If you run IDASM.EXE from the path you will be popped with the IDASM exe program as shown in figure ILDASM. Click on file and

What is Difference between NameSpace and Assembly?

Following are the differences between namespace and assembly :

  • Assembly is physical grouping of logical units. Namespace logically groups classes.

  • Namespace can span multiple assembly.

What is NameSpace?

Namespace has two basic functionality :-

  • NameSpace Logically group types, example System.Web.UI logically groups our UI related features.

  • In Object Oriented world many times its possible that programmers will use the same class name.By qualifying NameSpace with classname this collision can be avoided.

What are the different types of Assembly in .Net?

There are two types of assembly Private and Public assembly. A private assembly is normally used by a single application, and is stored in the application's directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. Crystal report classes which will be used by all application for Reports.

Wednesday 19 October 2011

Other than in a for statement, when is the comma operator used?

The comma operator is commonly used to separate variable declarations, function arguments, and expressions, as well as the elements of a for statement. Look closely at the following program, which shows some of the many ways a comma can be used:

#include <stdio.h>
#include <stdlib.h>
void main(void);
void main()
{

/* Here, the comma operator is used to separate
three variable declarations. */
int i, j, k;

Can the last case of a switch statement skip including the break?

Even though the last case of a switch statement does not require a break statement at the end, you should add break statements to all cases of the switch statement, including the last case. You should do so primarily because your program has a strong chance of being maintained by someone other than you who might add cases but neglect to notice that the last case has no break statement. This oversight would cause what would formerly be the last case statement

What is a Assembly in .Net?


  • Assembly is unit of deployment like EXE or a DLL.



  • An assembly consists of one or more files (dlls, exe’s, html files etc.), and represents a group of resources, type definitions, and implementations of those types. An assembly may also contain references to other assemblies. These resources, types and references are described in a block of data called a manifest. The manifest is part of the assembly, thus making the assembly self-describing.



  • An assembly is completely self-describing.An assembly

What is a Managed Code?

Managed code runs inside the environment of CLR i.e. .NET runtime. In short all IL are managed code. But if you are using some third party software example VB6 or VC++ component they are unmanaged code as .NET runtime (CLR) does not have control over the source code execution of the language.

List out some reasons for process termination.


  • Normal completion

  • Time limit exceeded

  • Memory unavailable

  • Bounds violation

  • Protection error

  • Arithmetic error

  • Time overrun

  • I/O failure

  • Invalid instruction

  • Privileged instruction

  • Data misuse

  • Operator or OS intervention

  • Parent termination.

What is Project 802?

It is a project started by IEEE to set standards to enable intercommunication between equipment from a variety of manufacturers. It is a way for specifying functions of the physical layer, the data link layer and to some extent the network layer to allow for interconnectivity of major LAN protocols.

It consists of the following:

  • 802.1 is an internetworking standard for compatibility of different LANs and MANs across protocols.

  • 802.2 Logical link control (LLC) is the upper sublayer of

How are exceptions handled in PL/SQL?

PL/SQL exception handling is a mechanism for dealing with run-time errors encountered during procedure execution. Use of this mechanism enables execution to continue if the error is not severe enough to cause procedure termination.

The exception handler must be defined within a subprogram specification. Errors cause the program to raise an exception with a transfer of control to the exception-handler block. After the

Predict the output or error(s) for the following:

 main()

            {

            static int var = 5;

            printf("%d ",var--);

            if(var)

              main();

            }

Answer:

5 4 3 2 1

Explanation:

When static storage class is given, it is initialized once. The change in

Tuesday 18 October 2011

Is a default case necessary in a switch statement?

No, but it is not a bad idea to put default statements in switch statements for error- or logic-checking purposes. For instance, the following switch statement is perfectly normal:

switch (char_code)
{
case ‘Y’:
case ‘y’: printf(“You answered YES!\n”);
break;
case ‘N’:
case ‘n’: printf(“You answered NO!\n”);
break;
}


Consider, however, what would happen if an unknown character

What is a CLS(Common Language Specification)?

This is a subset of the CTS which all .NET languages are expected to support. It was always a dream of Microsoft to unite all different languages in to one umbrella and CLS is one step towards that. Microsoft has defined CLS which are nothing but guidelines that language to follow so that it can communicate with other .NET languages in a seamless manner.

What is a CTS?

In order that two language communicate smoothly CLR has CTS (Common Type System). Example in VB you have “Integer” and in C++ you have “long” these datatypes are not compatible so the interfacing between them is very complicated. In order to able that two different languages can communicate Microsoft introduced Common Type System. So “Integer” datatype in VB6 and “int” datatype in C++ will convert it to System.int32 which is datatype of CTS. CLS which is covered in the coming question is subset of  CTS.

Note: If  you  have undergone COM programming period

What is time-stamping?

It is a technique proposed by Lamport, used to order events in a distributed system without the use of clocks. This scheme is intended to order events consisting of the transmission of messages.

Each system 'i' in the network maintains a counter Ci. Every time a system transmits a message, it increments its counter by 1 and attaches the time-stamp Ti to the message. When a message is

What are the types of Transmission media?

Signals are usually transmitted over some transmission media that are broadly classified in to two categories.

a) Guided Media:


These are those that provide a conduit from one device to another that include twisted-pair, coaxial cable and fiber-optic cable. A signal traveling along any of these media is directed and is contained by the physical limits of the medium. Twisted-pair and coaxial cable use

Name two utilities that Oracle provides, which are use for backup and recovery.

Along with the RDBMS software, Oracle provides two utilities that you can use to back up and restore the database. These utilities are Export and Import.

The Export utility dumps the definitions and data for the specified part of the database to an operating system binary file. The Import utility reads the file produced by an export, recreates the definitions of objects, and inserts the data.

If Export and Import are used as a means of backing up and

Predict the output or error(s) for the following:

  main()

{

            float me = 1.1;

            double you = 1.1;

            if(me==you)

                  printf("I love U");

          else

                 printf("I hate U");

}

Answer:

I hate U

Explanation:

Sunday 16 October 2011

Types of programming language:

Non-procedural Approach:

It is a language, which doesn’t support any structured or systematic way in its execution. It will increase the complexity. Debugging is very difficult because it will not support procedure-orientation or modularity.

Procedure-oriented Approach

Divide the program into different sections and each and every section will do some specific task. That section is called module or procedure or a function. What ever the set of statements which are repeated number of times will be placed into a module will decrease the

  1. Complexity

  2. Memory wastage

  3. Retyping time

  4. Compilation time


It follows top-down approach

It contains set of steps, which are required to develop a project

  1.  Planning

  2. Analysis

  3. Designing

  4. Coding

  5. Debugging

  6. Testing

  7. Documentation

  8. Maintenance


Drawbacks of Procedure Oriented Approach: -

  1.  In the procedure- oriented approach, entire concentration is on Procedures only.

  2.  So it doesn’t concentrate on security to the data.

  3. It gives the freedom to the data.

  4. It will not provide any reusability.


Object- - Oriented Programming:

To over come the above drawbacks, we have to introduce Object-Oriented approach. It will support both procedure-oriented and object oriented Methodologies.

Every object must have set of properties to express its behavior and sets of actions are used to change the behavior while modifying the properties so that more than 1 object may have set of properties and actions commonly, without repeating these properties and actions common to more than 1 object in a single unit to maintain the reusability. That unit is called class.

Class:

Class is a template, which contains the set of properties and actions to specify the behavior of objects and provide security to the data. It will give an abstract view of given real life entity to create model.

Object:

It is a communicate entity to provide the communication among set of classes. It will store the state of a class at a particular time.

Instance:

It is a state of a class at a particular time but it cannot preserve that state for future use. But in the case of objects, they are the preserving mechanisms to maintain the state for future use.

What is database Trigger?

A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can be defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted. For any one table,

Predict the output or error(s) for the following:

  void main()

{

            int  const * p=5;

            printf("%d",++(*p));

}

Answer:

                        Compiler error: Cannot modify a constant value.

Explanation:

p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".

 

Saturday 15 October 2011

What is a CLR?

Full form of CLR is Common Language Runtime and it forms the heart of the .NET framework. All Languages have runtime and its the responsibility of the runtime to take care of the code execution of the program. For example VC++ has MSCRT40.DLL,VB6 has MSVBVM60.DLL, Java has Java Virtual Machine etc. Similarly .NET has CLR. Following are the responsibilities

Friday 14 October 2011

Is a default case necessary in a switch statement?

No, but it is not a bad idea to put default statements in switch statements for error- or logic-checking purposes. For instance, the following switch statement is perfectly normal:

switch (char_code)
{
case ‘Y’:
case ‘y’: printf(“You answered YES!\n”);
break;
case ‘N’:
case ‘n’: printf(“You answered NO!\n”);
break;
}


Consider, however, what would happen if an unknown character code were passed to this switch statement. The program would not print anything. It would be a good idea, therefore, to insert a default case where this condition would be taken care of:


...
default: printf(“Unknown response: %d\n”, char_code);
break;
...


Additionally, default cases come in handy for logic checking. For instance, if your switch statement handled a fixed number of conditions and you considered any value outside those conditions to be a logic error, you could insert a default case which would flag that condition. Consider the following example:

void move_cursor(int direction)
{
switch (direction)
{
case UP: cursor_up();
break;
case DOWN: cursor_down();
break;
case LEFT: cursor_left();
break;
case RIGHT: cursor_right();
break;
default: printf(“Logic error on line number ld!!!\n”,  __LINE__);
break;
}
}

Registry

Two Types of Control

Although, in general, the Registry controls all 32-bit applications and drivers, the type of control it exercises is based on users and computers, not on applications or drivers. Every Registry entry controls a user function or a computer function. User functions would include the desktop appearance and home directory, for example. Computer functions are related to installed hardware and software, items that are common to all users.

Some application functions affect users, and others affect the computer and are not specifically set for an individual. Similarly,

Thursday 13 October 2011

Registry

Data File for OS to Hardware/Drivers:

The Registry is a database of all the settings and locations of 32-bit drivers in the system. When the OS needs to access hardware devices, it uses drivers, even if the device is a BIOS-supported device. Non-BIOS-supported devices that are installed must also have a driver. The drivers are independent of the OS, but the OS needs to know where to find them, the filename, the version, and other settings and information. Without Registry entries for each of the devices, they would not be usable.

Data File for OS to Applications:

When is a switch statement better than multiple if statements?

A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type. For instance, rather than the code

Tuesday 11 October 2011

What is difference b/w static IP address and dynamic IP address?

IP addresses assigned by a DHCP server are static dynamic IP addresses while the one released by IEEE (through the ISP) are dynamic IP addresses. OR

Static address is given by administrator manually.

Dynamic address is given by DHCP server. OR

How to prevent Asthma?

Asthma
Studies conducted at yoga institutions in India have reported impressive success in improving asthma. It has also been proved that asthma attacks can usually be prevented by yoga methods without resorting to drugs.

Physicians have found that the addition of improved concentration abilities and yogic meditation together with the practice of simple postures and pranayama makes treatment more effective. Yoga practice also results in greater reduction in anxiety scores than drug therapy. Doctors believe that yoga practice helps patients by enabling them to gain access to their own internal experience and increased self-awareness.

What the Registry Does?

The Registry is the data file for all 32-bit hardware/driver combinations and 32-bit applications in both Windows NT and Windows 95. Sixteen-bit drivers do not work in NT, so all devices are controlled through the Registry, even those normally controlled by the BIOS. In Windows 95, 16-bit drivers will continue to work as real-mode devices, and they use SYSTEM.INI for control.


Sixteen-bit applications will work in either NT or 95, and the applications still refer to WIN.INI and SYSTEM.INI files for information and control.

Without the Registry, the operating system would not have the necessary information to run, to control attached devices, to launch and control applications, and to respond correctly to user input.

Monday 10 October 2011

What is the Registry?

The Registry has been made out to be a phenomenal mystery probably due to the CLSID keys alone and as such has inspired a number of books, faqs websites etc. It is very unfortunate that Microsoft has chosen to deal with the Registry and Registry editing as a "black art," leaving many people in the dark as to the real uses of all the settings in the systems. Microsoft's refusal

Sunday 9 October 2011

Predict the output or error(s) for the following:

main()

{

printf(“%p”,main);

}

Answer:

Some address will be printed.

Explanation:

Function names are just addresses (just like array names are addresses).

main() is also a function. So the address of

Thursday 6 October 2011

Benefits of Meditation

 

It lowers oxygen consumption.


It decreases respiratory rate.


It increases blood flow and slows the heart rate.


Increases exercise tolerance.

Real data types

The floating point data types are called "real data types".

Hence float, double, and long double are real data types.

How would you round off a value from 1.66 to 2.0 in C-language?

main()
{
printf("%f",ceil(1.66));
}

Output: 2.0