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 hl register pair is called as memory pointer?

Because in many statements you use HL as a pointer to memory data, eg:

LD B,(HL)

SUB A,(HL)

LD (HL),E

What is mean by file organization in data structure of c?

File organization is the methodology which is applied to structured computer files. Files contain computer records which can be documents or information which is stored in a certain way for later retrieval. File organization refers primarily to the logical arrangement of data (which can itself be organized in a system of records with correlation between the fields/columns) in a file system

Why merge sort is not in-place?

this use auxiliar data structure for to work, in-place is that on the same data structure of input this sort

Can i c u?

A school teacher injured his back and had to wear a plaster cast around the upper part of his body. He wore it under his shirt and it was not noticeable at all. On the first day of the term, still with the cast under his shirt, he found himself assigned to the toughest class in the school.

Walking confidently into the rowdy classroom, he opened the window as wide as possible and then busied himself with desk work. The classroom became a bit unruly and he admonished them. This happened several times.

While working at his desk, the strong breeze from the window made his tie flap annoyingly. He kept rearranging and rearranging the tie as the class become more and more unmanageable.

Finally, becoming disgusted with the wayward tie, he stood up and took a big stapler off his desk and stapled the tie to his chest in several places.

Discipline was not a problem from that day forth.

How can you make a horse game?

all you have to do is go to google and type in make your own horse game

Prove by mathematical induction that the complexity of binary search algorithm is log n?

The complexity of the binary search algorithm is log(n)...

If you have n items to search, you iteratively pick the middle item and compare it to the search term. Based on that comparision, you then halve the search space and try again. The number of times that you can halve the search space is the same as log2n. This is why we say that binary search is complexity log(n).

We drop the base 2, on the assumption that all methods will have a similar base, and we are really just comparing on the same basis, i.e. apples against apples, so to speak.

Program to convert binary to decimal without using array?

Suppose your binary number is stored in a series of bits in the unsigned long type named bits.

Then the fragment of a C program to convert this number to a decimal value would be ..

double decimal_value = 0.0;

for ( unsigned long i = 0; i < sizeof(unsigned long); ++i)

{

decimal_value += pow(2,i) * ( bits & 1 );

bits >> 1; // shift all the bits to the right one spot.

} // end for i

Doing this work is generally unnecessary as functions such as these are built in to most programing languages.

Another method for this: double decimal_value= bits;

How do you count the no of keywords in c?

1. Get the list of the keywords.

2. Use your fingers to count.

Highlight the steps involve in writing a functional program?

Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.

In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.

Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.

In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.

Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.

In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.

Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.

In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.

What is algorithm to write algorithm to the program to access a pointer variable in structure?

Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.

name_of_the_structure dot name_of_the _field,
eg:

mystruct.pointerfield

Write a program to read a positive integer N and find the average of all even numbers between 1 and N inclusive Perform any necessary validates?

int AverageEvenNumbers( int n )

{

return ( n / 2 ) + 1;

}

n / 2 will always give you an int, aka no decimals

if n is 5 the even numbers are 2 and 4, the average is 3

(5) / 2 is 2

2 + 1 is 3

if n is 10 the even numbers are 2 4 6 8 10, the average is 6

10 / 2 is 5

5 + 1 is 6

enjoy

What is a double stack magazine?

The magazine of a gun holds the bullets. Most magazines are single stack - each bullet directly above the next. Double stack magazines have 2 rows of bullets, slightly staggered.

Which Loop avoids check at every iteration?

All loops available in Java (for, while, do-while) have a loop termination condition that would get executed during every iteration of the loop. Without checking the loop condition the loop cannot be terminated and hence avoiding the loop condition check during iteration is not logic and Java does not do it.

What type of document is the Declaration of Independence?

It is an enlightened document. The reason for this is because it is based off of philosophies which came from The Enlightenment period.

It identified and focused on principles and issues that would unify the various colonial groups.

Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50 percent in the test. Make necessary assumptions?

Write a C program to read the internal test marks of 25 students in a class and

show the number of students who have scored more than 50% in the test.

Make necessary assumptions

How much are the size of memories of in built data types of C plus plus?

sizeof (typename) will tell you.

Here are some possible variations:

WinDos 16/small:

1: char

2: short, int, pointer

4: long

WinDos 16/large:

1: char

2: short, int

4: long, pointer

Windows 32, unix 32:

1: char

2: short

4: int, long, pointer

8: long long

Windows 64:

1: char

2: short

4: int, long

8: long long, pointer

Unix 64:

1: char

2: short

4: int

8: long, long long, pointer