answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

What is the composition of naphthalene balls?

napthalene has got double ring system having alternate doublebond

What is the Necessity of earthing in computer?

Earthing is a vital safety feature in domestic and business power supplies. Most equipment such as refrigerators or convection heaters has a separate earth wire along with the live and neutral wires which carry the current. This connects the external surfaces of all such equpiment together, independently of the supply, so that the voltage between all surfaces which might be touched is zero and therefore safe even if some types of common fault occur. The earth wire is also connected physically to the gas and water pipes and to the ground in all properties. Certain portable low-power items with double insulation and no metal exterior surfaces do not require an earth lead.

<<>> Earthing or Grounding (depending on where you live) is a practice of connecting one terminal of the generator to the Earth's ground, and then doing the same at the load (user end).

This gives us two main benefits.

1. Most importantly, if the hot wire comes in contact with the earthed frame, then a very high fault current will flow, which will cause the protective device to operate, and shut down the supply before harm or fire can occur.

2. As already stated above, It limits the touch voltage on the frame of the device to a safe level, so that persons contacting the frame are not likely to come in contact with a hazardous voltage.

This type of protection is bets achieved when the neutral wire is connected to the earthing system at multiple locations, This is called an MEN (multiple Earth Neutral) System or in IEC speak a TN (Terra Neutral) system. The more earths in the systems, the more effective earth bonding of appliances is.

Below gets a littl heavy for this question, but it's valid.

If you could have an ideal ungrounded system, the generator could be ungrounded, then a person could touch one live wire without a path for current to flow through his body. Ideal is the key word here. Nothing is ideal. There are capacitive and inductive currents between the transmission lines and ground, so that even an ungrounded generator would actually have a return path for current. Also note that both wires will be 'hot' in an ungrounded system, rather than just one (there is no neutral wire).

Think about this. A capacitor is two plates separated by a dielectric. But if you have miles of transmission line even 100 feet in the air will act like a capacitor. Since the current is alternating, the transmission lines act sort of like a broadcast antenna for electromagnetic waves (very low frequency - 60 Hz - though), but some current could be induced into metal objects that are touching the ground, like thousands of tiny receiving antennas.

Therefore, you want to ground one of the generator terminals, and then ground the corresponding terminal at the load (the user end). Now you have created a path to ground which has much less impedance to current flow than the sum of these inductances and capacitances created by the transmission line. By having the 'neutral' wire grounded, you can also connect any metal parts in your appliance to ground, so that if there is a short to an exposed metal part, the breaker will trip rather than just energizing the entire device.

Imagine you are on an ungrounded system and your entire toaster were hooked to the 'hot' side, rather than the neutral side, for example.

Note that you could experience this situation if you are running a portable generator, which is not electrically connected to Earth's ground.

Is HTML a computer programming language?

To "mark up" means to determine the look and structure of a text (font type, size, color).

The transition to a "programming language" is theoretically fluent - but generally a markup language is to determine how things look, and a programming language is to determine how things react to user actions.

When websites are "interactive" - for example, if they contain games, or movable sub-windows or small text-editors - this is realized not with HTML, but with Javascript or Flash or Java, which are separate formats that can be integrated in HTML. They themselves are programming languages, HTML is not.

What is advantages of computer in hospital?

Well do you mean for the purposes of research and development? To process, create, and display numerous things to complicated for most minds. Like DNA sequencing, development of drugs and treatments, logging large numbers of test studies.

For more mundane things, to keep track of patient records, take x-rays, see things we can't, some forms of remote surgery.

A great many things more as well. Please be more specific to receive more relevant help.

Write a program to extract a portion of a character string and print the extracted string Assume that m?

#include<stdio.h>

#include<string.h>

void main()

{

char str[50];

char ext[50];

int pos,len,i,j=0;

printf("\nenter the main string.....-\n");

gets(str);

printf("\nenter the position and length of the string to be extracted...-\n");

scanf("%d%d",&pos,&len);

for(i=pos-1;i<len+pos;i++)

{

ext[j++]=str[i];

}

puts(ext);

}

/* this is a much easier solution by : ROHIT VERMA*/

Difference between break and goto in C?

The break statement will immediately jump to the end of the current block of code.

The continue statement will skip the rest of the code in the current loop block and will return to the evaluation part of the loop. In a do or while loop, the condition will be tested and the loop will keep executing or exit as necessary. In a for loop, the counting expression (rightmost part of the for loop declaration) will be evaluated and then the condition will be tested.

Example:

#include main() { int i; int j = 10; for( i = 0; i <= j; i ++ ) { if( i == 5 ) { continue; } printf("Hello %d\n", i ); } } #include main() { int i; int j = 10; for( i = 0; i <= j; i ++ ) { if( i == 5 ) { continue; } printf("Hello %d\n", i ); } } #include main() { int i; int j = 10; for( i = 0; i <= j; i ++ ) { if( i == 5 ) { continue; } printf("Hello %d\n", i ); } }

for(int i = 0; i < 10; i++){

if(i == 0) continue;

DoSomeThingWith(i);

}

will not execute DoSomeThingWith for i = 0, but the loop will continue and DoSomeThingWith will be executed for i = 1 to i = 9.

Define DDL and DML?

SQL

These are the main categories are

DDL(Data Definition Language)

DML ( Data Manipulation Language)

DQL( Data Query Language)

DCL( Data control Language)

Data administration commands

Transactional control command.

ddl includes insert ,delete ,update values

it include select statements,

it include insert statement,

it includes drop statements

What are the steps involved in creating visual basic programs?

The traditional way to learn any programming language is to start by writing a "Hello, World" program; this program should write "Hello, World" to the screen. To write such a program, you have to work out how to edit text, and run it through the compiler. Visual Basic, is almost like that, but window environment programs are event driven - they consist of routines that react to events - a button being clicked, a timer expering and so on. Visual Basic is also object orientated. Windows, buttons, every component of a program are objects or part of objects. With this in mind, its useful to read up on events and objects to see how to approach Visual programming. With a little knowledge, think of a project and try and write a program. Writing programs is by far the quickest way to become proficient in a language.

Write a program using c plus plus to check whether the given square matrix is symmetric or not?

means whether the matrix is same or not

program for symmetric matrix :

include<stdio.h>

#include<conio.h>

main()

{

int a[10][10],at[10][10],k,i,j,m,n;

clrscr();

printf("enter the order of matrix");

scanf("%d %d",&m,&n);

printf("enter the matrix");

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

scanf("%d",&a[i][j]);

}

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

at[i][j]=a[j][i];

}

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

if(at[i][j]!=a[i][j])

k=1;

}

}

if(k==1)

printf("not symmetric");

else

printf("symmetric");

getch();

}

How has programming emerged since the invention of computers?

The spell check is one of most used computer programs or modules. It has made us not to do the spell check ourselves.

What are the education requirements for computer programming?

Im looking for that answer as well, but you need some advanced math for expressions and algebra. Also, alot of patience >.< In fact, I just started programming in C++. If you read alot of guides, theres not really need for lots of education. Im reading some really good free online guides at the moment... If you plan on learning C++, i suggest reading these guides... http://msdn.microsoft.com/nb-no/beginner/cc305129(en-us).aspx (on the right side of the page) So far for me, theres been no need for advanced maths. Hope this helped ;)

What are the applications of array?

arrays are used to store the group of data which are of same type.

These arrays can be applied in student mark sheet applications,online library applications etc.

What is the importance of documentation in programming life cycle?

Documentation is critical unless you are the only person who will ever, ever, ever look at a piece of code. And even then, if you go away from it for 6 months you will probably have trouble remembering what you did.

In business, code MUST be commented because the person fixing or enhancing the program is often not the person who wrote it. It can take 4 or 5 times as long to figure out what a program is doing when you only have the computer-language logic available, as opposed to an English-language explanation of the underlying concepts.

It's also critical to keep the documentation up to date and accurate in both facts and spelling. If the code has been changed and the documentation hasn't, that disagreement can mislead anyone who comes along and tries to work on the code later. If you can't spell or use lousy grammar, it can make it a lot harder to perform text searches looking for a particular phrase that's likely to appear in a comment. Try searching for PARAMETER when somebody spelled it PARAMATER, for example (I've had to do just that!!)

The above is an explanation to why documentation is important in one of levels of software documentation - Technical or Code Documentation. There are other levels of documentation including Software Requirements Documentation, Software Architectural/Design Documentaion and End-User Documentation (e.g.: Manuals, Tutorials). Documentation at each of these levels is usually necessary, or at least desired, for most non-trivial software projects. For more information on these levels of documentation and to who and how it may be important, pls see http://en.wikipedia.org/wiki/Software_documentation

What advantages does batch processing have over real-time processing?

The main advantage of real-time processing is that you will get results immediately. This will allow one to make quick decisions before too much time is wasted as they are able to monitor the process in real time.

What are the feature of C language?

An array is simply a contiguous allocation of one or more elements of a given type.

int i; // a single element of type int

int j[100]; // an array of 100 elements of type int

The elements of an array are anonymous (we can't refer to them by name because they have no names). However we can access them by their offset address from the start of the array. The array name serves as a reference to the start of the array and will implicitly convert to a pointer:

int* p = j;

Each element of an array is offset by sizeof (type) bytes. However, the offset is known to the compiler so we do not need to specify it when accessing array elements, we only need to know the zero-based index of the element we wish to access:

int k = j[42];

Note that the suffix operator [] does not perform a range-check. It is up to the programmer to ensure the given index is in range. The array named j has 100 elements so all indices must be in the range 0 through 99. Access beyond the range of an array has undefined behaviour:

int m = j[100]; // undefined behaviour

Given j is a reference, we can also use pointer arithmetic to access elements:

int n = j + 42;

From this we can see that the following holds true:

j[42] 42[j]

It often surprises people to learn that j[42] and 42[j] are equivalent, however it's only because the suffix operator is sugar-coating for the underlying pointer arithmetic so the compiler sees 42 + j, not 42[j]. However, low-level trickery such as this has no place in production code.

The elements of an array are uninitialised at the point of instantiation. However we can use an initialiser to set initial values:

int j[5] = {5, 10, 15, 20, 25};

When we pass arrays to functions, the array implicitly converts to a pointer. This means information is lost in the exchange because the function cannot know how many elements are being referred to by the pointer. Thus we must pass the length of the array as a separate argument:

void f (int* arr, unsigned size) {

for (unsigned idx=0; idx<size; ++idx) {

arr[idx] = 0;

}

}

Given that arrays implicitly convert to pointers, variable-length arrays are treated exactly the same as fixed-length arrays, the only difference is that the programmer is responsible for allocating and releasing the memory:

void g (unsigned size) {

int* p = malloc (size * sizeof (int)); // allocate

f (p, size); // use

free (p); // release

}

Note that variable-length arrays cannot be initialised at the point of instantiation; they must be instantiated then initialised, as shown above.

Fixed-length arrays (where the length is known to the compiler) can be allocated in static memory, on the call stack or on the heap. Global arrays are best allocated statically while small local arrays are best allocated on the stack. Large local arrays should be allocated on the heap. Variable-length arrays must always be allocated on the heap.

Types of data type?

A data type that can store integer numbers. The details vary depending on the programming language; many language have different integer types to accomodate different sizes. This lets the programmer use a smaller size (and save memory space) when he only needs to store fairly small numbers - and especially when he needs to store LOTS of fairly small numbers, as in an array. Common sizes include 1 byte, 2 bytes, 4 bytes and 8 bytes of storage.

What does mangle mean?

Function mangling is a process where some languages, notably C, alter the function's link symbol in order to create unique names for functions with the same name but different parameters. The linker can then distinguish between which function to call by comparing the object code's mangled function calls to the call table. As a simple example, given a function such as int foo(int bar), the function might become managed as _foo@4. Then, when the C compiler finds a call such as foo(4), it will generate a linker call such as "push 4; call _foo@4;".

Difference between dos and c programming?

Answer: In dos you have to create the complete application, yourself in other words the complete .EXE file, that can be done in any of the many different programming languishes IE. GWBasic, QBasic, C, or ASM etc., the last is the most difficult but the result is the fastest application. Where Windows is a platform for your application, most of the things you want to do is already created in Windows, all you have to do, is to use it from within your application, not that it means less programming, you actually have to do more coding than with Dos, for instance in Dos GWBasic, if you want to read data from a comm. port you just open it as follow

[code]

open "comm1:" for input as #1

input #1, var

close #1

[/code]

But in Windows it is a long story

What is the concept of hacking?

Hacking is the practice of understanding the workings of a system. Hackers do not Break into systems, do anything illegal, or unlawful. Hackers are intelligent people who do not abuse privileges or discoveries. If you are trying to break into a system or something, You are committing a crime. This is called cracking. Cracking is ILLEGAL. Cracking is also unlawful and should be avoided.

What program makes computer program tasks?

The tools required to write computer programs are very simple and readily available. You will need:A text editorSome knowledge of the programming language you plan to learn/useA compiler or interpreter for the language you wish to useYou could start off with any programming language you wanted to. However, some are easier to pick up than others.

Python: Python is simply the best language for starting out with according to many people. Python, like most mainstream programming languages, is cross-platform. Python is also very easy to pick up.

C: Perhaps the most famous programming language of all time. C is the basis for many widely used modern languages, such as C++, Objective-C, and JavaScript. It is practically inevitable that you will one day need to learn C. For this reason, many programmers advocate it as the best starting language. However, you don't need to learn it if you want to just specialize in one programming language.

What is an empty HTML element which does not have a closing tag?

<html>

<body>

<div></div>

</body>

</html>

that is an empty div tag, there is nothing in between the <div> and </div>

When did Grace Hopper make COBOL?

Grace Hopper did not make COBOL, but she was technical consultant upon the committee and influential in its design following her work on the FLOW-MATIC language, which was combined with ideas from the IBM equivalent, COMTRAN. COBOL was first released in 1959.