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 does not use FIFO in stack?

A FIFO, or First In First Out is a queue.

A stack is a LIFO or Last In First Out.

When did Dennis Ritchie create C?

He worked on it with BellLabs throughout the 1960s.

Do records fall under linear or non linear data structures?

A record is a compound data structure composed of heterogeneous fields. The memory layout of an individual record is linear insofar as the fields are allocated contiguously, however a group of records is not necessarily linear. It all depends upon how the records are linked together and that's ultimately defined by the data container. Generally speaking, arrays and lists are linear data structures while graphs and networks are non-linear.

What are the arithmetical operations in a computer?

An "algorithm" is just a list of step-by-step instructions.

For example, here's an algorithm for adding two numbers:

  1. Equipment needed: An area of clear ground and a pile of small stones beside it.
  2. Count stones equal to the first number to be added.
  3. Put the counted stones in the center of the clear ground.
  4. Count stones equal to the second number to be added.
  5. Add the counted stones to those already in the center of the clear ground.
  6. Count the entire pile of stones in the center of the clear ground.
  7. The count is the sum of the two numbers to be added.

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.

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 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.

Appending array elements using function in c plus plus programming?

#include<iostream>

void append(std::vector<int>& v, int i){ v.push_back(i); }

int main()

{

std::vector<int> v;

append( v, 100 ); // same as calling v.push_back(100);

return(0);

}

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.

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.

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.

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.

What is DAG in compiler?

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

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.

What is the range of real constant in c?

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

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 ideal compiler?

3 Conditions to follow:

1. fast

2. language self

3. Correct, Repair, Dictate fast accuracy