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

How do you convrt the decimal number to binary?

One method is to try what powers of 2 you can add up to give the decimal number. For example, 20 in decimal: The next-lower power of 2 is 16; the following powers of two are 8, 4, 2, 1. After subtracting 16, you see how often you can fit the next power-of-two (8); the answer is zero. The next power-of-two (4) fits once. Since nothing is left over, the next two powers-of-two (2 and 1) fit zero times. In summary, you have 1x16, 0x8, 1x4, 0x2, 0x1, which in binary reads 10100.

How is anode inserted in a linked list?

suppose that a linked list which have 4 nodes.

Example:-

10->20->30->25->50->NULL

there is three way to insert the node in this list.

1. from beginning position

2. from ending position

3. from specific position

Does there exist any way to make the command line argument available to other function without passing them as arrguments to function?

The only way this can be achieved is by storing the command line arguments in global variables. However, this is not recommended. Global variables should only be used to represent truly global concepts, but command line arguments are local to the main function. The main function's primary role is to parse the command line arguments and invoke the appropriate functions, passing any required arguments (by value) to those functions that specifically require them. The main function's secondary role is to handle any exceptions not handled by the functions that it invokes.

Write Algorithm to perform the insertion and deletion operation of a linear array?

//Algorithm to perform the insertion and deletion operation of a linear arrayINSERT (ArrA, n, i, item) where ArrA is a linear array with n elements and i is a positive integer where i <=n. The element 'item' will be inserted into the ith position in ArrA.1. j = n2. repeat steps 3 and 4 while j >= i3. ArrA[j+1] = ArrA[j]4. j = j - 15. ArrA[i] = item6. n = n+1DELETE (ArrA, n, i, item) where ArrA is a linear array with n elements and i is a positive integer where i <=n. The element 'item' will be deleted from the ith position in ArrA.1. item = ArrA[i]2. repeat for j = i to n -1 ArrA[j] = ArrA[j+1]4. n = n - 1NO HARD RETURNS ALLOWED

How do you analyze a program?

Assuming you're meaning to check if the program works - run it with some test data that you know what the solution should be be if the program works correctly. If you get the expected result, the program is fine - if not - it needs de-bugging.

What is data field?

A data field is a place where data can be stored. It may be a column in a database or a field in a data entry form.

How do draw the Gantt chart to illustrate Round-robin scheduling?

You can draw the Gantt chart by using Microsoft Excel which will allow you to input the exact data you have collected and be able to determine the results in various ways.

Is there any c program that could read c program too?

I don't really understand your question, but maybe it is the compiler what you mean.

Why c language cannot be developed in any other programming language?

Your question makes no sense. If you wanted to ask if it is possible to write a C-compiler in another programming language, the answer would be yes.

Similarities between C plus plus struct and class?

The only difference between a struct and a class in C++ is that struct members are public by default while class members are private by default. Other than that they act and behave in exactly the same way and are both used to define classes. By convention, struct is used exactly as it would be used in C, with all public members and no member functions, to provide backward compatibility with C-style code.

What is the range of real constant in c?

Depends on data-type. For 'short int', for example, it is -32768..32767.

What is DAG in compiler?

Directed Acyclic Graph,Used to derive TAC- three address code to generate target code.

What is ideal compiler?

3 Conditions to follow:

1. fast

2. language self

3. Correct, Repair, Dictate fast accuracy

Which header file should be included in c to enable string conversion?

What conversion do you mean? For example strtol is defined in stdlib.h, sprintf is defined in stdio.h.

Why not sending arefrence to copy constructor will cause an infinite loop?

A copy constructor gets called any time an object needs to be copied. Unlike in some of the newer languages like Java, you can chose to pass objects either by reference or by value. When you pass by reference, only the address of the function is copied. However, if you pass by value, the whole object must be copied. In order to copy the object, the copy constructor will get called.

If the copy constructor's parameter is not a reference, then the object will get passed by value. When the object gets passed by value, it needs to get copied so it will call the same copy constructor. Because the object is still being passed by value it'll call itself again to create a copy of itself. The copy constructor will continue to call itself until the stack overflows.

What is initgraph?

A function in Borland's graphics library in TurboC; switches to graphics mode.

What symbol would you use to subtract?

Well, it's quite simple i'll try just to tell you but not a long talk

this is the sign (-) - minus.

here is an example 100(-)55= 45.

What is the difference between 0x1 and 0x01 in c language?

0x means hexadecimal (base-16). Just like in decimal, 1 and 01 are the same number.

What are sentences that appear to be written in a programming language but do not actually follow the structure of the language?

Pseudocode. It is a cross between English and a programming language, designed to be quickly written and understood without worrying about syntax.