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

What does this mean 9 L of a c?

Answer9 = Lives of a Cat

in other words: a cat has 9 lives.

Write a function in java that accepts an array of integers and returns the second largest integer in the array Return -1 if there is no second largest?

Method 1:

Sort the array in descending order, compare 1st and 2nd if not same , return 2nd if same return -1

Method 2:

Find the largest number in the array, initialize another array with dimension 1 less than of original. Copy the array elements from the original array minus the largest element. not select largest from the second array and compare with the previous one if not same return the second largest if same return -1

What are the characteristics of a good algorithm?

Every algorithm should have the following five characteristics: 1. Input

2. Output

3. Definiteness

4. Effectiveness

5. Termination

What is inline function in C Can you make inline function recursive or not If make can complier will compile that code?

The inline attribute is a C++ attribute, not a C attribute.

Inline specifies that the function is to be expanded in place at the point of call instead of being called as a function. This means there will be one copy of the function for each call. This costs executable code, but can save execution time because the call setup and return time is avoided. Some functions cannot be inlined, and inline is really only a hint to the compiler.

As far as recursive inlined functions, that depends on the implementation. The Microsoft implementation will not inline recursive functions unless they have a #pragma inline depth(n) line that specifies the maximum recusion depth the function will have. Consult your specific compiler documentation for the inline attribute for your specific implementation details.

When will compilation error occur?

Syntax errors are typically picked up at design time by the code editor. If the programmer is no using a code editor (he is using notepad, for instance), syntax errors become compile time errors.

What is the binary number 11110000 in a decimal?

11110000 in decimal
(1 * 128) + (1* 64) + (1 * 32) + (1 * 16) + (0 * 8) + (0 * 4) + (0 * 2) + (0 * 1) =
128 + 64 + 32 + 16 + 0 + 0 + 0 + 0 =
240

Describe the functions of the 8086 queue?

The 8086/8088 instruction queue is a buffer that holds opcode bytes that have been prefetched by the bus interface unit. This speeds up operations of the processor by helping to reduce fetch latency, i.e. to improve the probability that an opcode byte fetched by the processor is already available.

What are the steps for a systematic approach to problem solving?

1. sit on chair and relax 2. watch t.v. all day 3. don't do anything 4. eat chips and ice cream all day 5. go to sleep 6. there are so many things you can do that I'm to lazy to say etc. XD

What a java program to find largest and smallest value store in the array?

Implement these methods:

public static int smallest(int[] arr) {

int small = arr[0];

for(int i = 1; i < arr.size(); i++)

if(arr[i] < small)

small = arr[i];

return small;

}

public static int largest(int[] arr) {

int large = arr[0];

for(int i = 1; i < arr.size(); i++)

if(arr[i] > large)

large = arr[i];

return large;

}

What is execution unit and bus interface unit?

In the 8086/8088, the execution unit is the part of the processor known as the CPU. It executes the instructions and generates the results. The bus interface unit, on the other hand, is the part of the processor that handles reading and writing to memory. The two are somewhat loosely coupled, with the bus interface unit attempting to always be ahead of the execution unit, i.e. using the cache, so that the execution unit's wait time is minimized and performance is maximized.

A pseudocode for finding the area of any circle?

Get radius (as parameter)

Calculate area = pi x radius squared

Return area

The above assumes you write a function or method that calculates the area and returns it.

Otherwise:

Ask for radius

Calculate area = pix radius squared

Show area

What does percent 3.2f means in c language?

3 digit wide and 2 digit precision. But some compiler wont show wide difference !!

What does med arr txble means?

MEDical ARRears TaXaBLE. This information is from Walmart HR. My wife signed up for medical in the middle of a monthly medical period. This one time $50 charge is the difference for the monthly medical period prior to the payment for the pay period.

How do you convert exe to binary?

An exe is machine code and machine code is written entirely in binary. No conversion is necessary.

A hex-editor is the simplest way to view the binary code. The code will be shown in hexadecimal rather than binary, however this actually makes it much easier for humans to interpret the binary code because the conversion from hex to binary is so simple. Each hex digit represents a unique 4-bit binary pattern:

0x0 = 0000

0x1 = 0001

0x2 = 0010

0x3 = 0011

0x4 = 0100

0x5 = 0101

0x6 = 0110

0x7 = 0111

0x8 = 1000

0x9 = 1001

0xA = 1010

0xB = 1011

0xC = 1100

0xD = 1101

0xE= 1110

0xF = 1111

Thus the hex value 0x9A translates directly to the 8-bit binary value 10011010. That is, 8 binary digits reduce to just 2 hex digits and therefore makes it much easier for humans to interpret the binary value.