answersLogoWhite

0

📱

C Programming

Questions related to the C Computer Programming Language. This ranges all the way from K&R to the most recent ANSI incarnations. C has become one of the most popular languages today, and has been used to write all sorts of things for nearly all of the modern operating systems and applications. It it a good compromise between speed, power, and complexity.

9,649 Questions

Why numeric arrays do not end with a '0' in C programming language?

The value zero is a perfectly valid numeric array element in its own right. If we used the value zero to mark the end of a numeric array in the same way we use a null-terminator to mark the end of a string (a character array), we'd have no way of representing the value zero within the array itself. Thus when working with numeric arrays, we must keep track of the array length independently of the array.

What is the meaning of VAX in computer education?

The abbreviation of VAX stands for Virtual Address Extension. VAX operating systems were introduced in 1978. VAX production continued until 2005 where the last of the newer systems were discontinued.

If quick sort and merge sort have same elements then what will be the complexity of both algorithms?

quicksort should be O(n^2), but merge sort should be O(nlogn).

but if you can modify partition algorithm with checking all values same in array from p to r, it could be O(nlogn).

How and why are variable names used in programming to process data?

Variable names are used so the code is readable. When the code is compiled to machine languages, it no longer uses the variable names to understand it's operations...sometimes variable names are kept as metadata to help debug but the computer does not need them to execute the program...they are for us so we can easily understand what we are doing.

Input and output of turbo c?

input

scanf() , getch() , getche()

output

printf() , putch() , putchar()

How do you Print data of all nodes of linked list?

Traverse the list from the head to the tail. Upon visiting each node, print the data it stores or refers to.

Electronic data interchange uses what type medium to transmit data?

Electronic data interchange uses long wave medium to transmit data. This data is supplied by the electronic data interchange in San Francisco, California.

What is the correct call to the library function strcat?

strcat (into, from); correct.

into (strcat, from); incorrect.

strcat (from, from); incorrect.

....

How many nodes are in a family branch tree in graph theory?

In Mathematics and Computer Science, the graph theory is just the theory of graphs basically overall. It's basically the relationship between objects. The nodes are just lines that connects the graph. There are a total of six nodes in a family branch tree for a graph theory basically.

What is the 2 ways to store data in memory?

You did not provide enough information to answer your question. Please clarify.

Choose the correct version of this statement in conditional form All elephants have trunks?

If the animal is an elephant, then it has a trunk((:

Or: If this animal had trunks, it would be an elephant.

What is a class c cdl?

The Class C CDL is intended for vehicles with a Gross Vehicle Weight Rating of under 26,000 lbs., but which still require a CDL. Some examples include:

  • Vehicles of any weight rating which are hauling a quantity of hazardous materials which requires placards to be displayed must be operated by a driver with a CDL and hazmat endorsement
  • Vehicles of any weight rating which are designed to transport more than 15 persons (including the driver) requires a CDL and passenger endorsement
  • New York State law requires than anyone operating a vehicle on a for-hire basis with a Gross Vehicle Weight Rating of more than 18,000 lbs. possess a CDL. A Class C CDL would cover vehicles with a GVWR of between 18,001 and 26,000 lbs.

Explain pointer of any data type that requires four bytes?

When a pointer to a data type that requires four bytes is declared, the compiler knows that the target object is four bytes in size. When the program then performs a calculation to offset the pointer, such as to add 3 (for instance) to the pointer, the generated code actually adds 12. This is because the compiler assumes that adding or subtracting numbers to or from a pointer is an attempt to use the pointer in an array context. (Actually, this behavior is defined in the language specification.)

The other valid arithmetic manipulation of a pointer is subtraction of two pointers to the same type of object. In this case, again, an internal multiplier of 4 is applied, and the result is an offset that could be used if the first pointer were the base of an array of those objects.

The size of the target object could be any value, such as a double which might be 8 bytes. The compiler will do the arithmetic correctly.

Also, keep in mind the distinction between the size of the pointer and the size of the object to which the pointer points. This answer assumes the latter.

In any case, the programmer must insure that the calculation results in a pointer or offset value that represents an address in the base object array, assuming that the allocated space of that object is correct. Any other result is inconsistent with the defined usage of a pointer, and the result of dereferencing such an inconsistent pointer or offset is undefined by the language specification, and could result in corruption, incorrect behavior, or crash.

Why recursive algorithm for Fibonacci series is inefficient?

Because the same calculations are done over and over again. Fib(n) - the nth. number in the sequence - is equal to fib(n-1) + fib(n-2). For example, fib(10) - the 10th. number in the sequence - is equal to fib(9) + fib(8). If you expand this, you get fib(8) + fib(7) + fib(7) + fib(6). If you expand again, you get fib(7) + fib(6) + fib(6) + fib(5) + fib(6) + fib(5) + fib(5) + fib(4). You can already see that some of the numbers have to be evaluated several times. In fact, the amount of calculations increases exponentially; whereas with a simple loop, to add numbers up to fib(n), this is not the case.

How do you search a supplier?

you enter the business and look around. Too vague a question.

How do you write a C-program for matrix multiplication?

it would have a part in it like this:

for (i=0; i<n; ++i) {

. for (j=0; j<l; ++j) {

. . sum= 0;

. . for (k=0; k<m; ++k) {

. . . sum += a[i][k] * b[k][j];

. . }

. . c[i][j] = sum;

. }

}