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

Design an algorithm to determine the largest element in a list?

Assume the first element is the largest and store its value. Then traverse the remainder of the list, one element at a time. If the current element's value is larger than the stored value, overwrite the stored value with the current element's value. Once you've traversed the list, the stored value will hold the largest value.

Which is the primary need to develop Java programming from C plus plus?

The primary need to convert any language source, including C++, to Java is simply one of portability.

While C++ is itself portable, writing cross-platform code requires that you write code in a more abstract manner than you would when writing for a specific platform, making extensive use of compiler directives to determine which version of each translation unit will be compiled upon which particular platform. This increases code maintenance because you must then maintain separate versions of the platform-specific code, as well as include a different set of headers for each platform, and thus call different functions for each platform. You must also compile the source separately upon each supported platform, which means the code must be as generic as possible in order to be understood by every possible compiler. Thus cross-platform C++ code tends to be limited to the most popular platforms only, which usually means Windows and Unix only.

Java's higher level of abstraction is such that you need only write one set of instructions and compile it one time only. The Java virtual machine handles all the low-level machine specifics, so the same executable will run on any machine that has a Java virtual machine implementation. While this greatly reduces code maintenance and increases portability, the need to interpret the compiled byte code (rather than native machine code which requires no interpretation) reduces performance enormously. Thus the ease of maintenance has to be weighed against the loss of performance to determine if it is a worthwhile exercise.

What subjects can you do if you are good at algebra but bad at computer programming in terms of writing code in every programming language including C plus plus and visual basic?

Just because you're good at algebra doesn't mean you have to be good at programming. Algebra is taught from a very early age (even in kindergarten) and it is one of those areas of mathematics, besides arithmetic and geometry, that virtually everyone uses every day without even realising it. It's such an elementary subject that there are no specific subjects you can do just because you're good at it. However, if you have a yearning to take algebra further then you might consider abstract algebra, an area of advanced mathematics studied primarily by professional mathematicians. No programming required, but there's absolutely nothing stopping you from learning to program. Even if you're no particularly good at it, it's still useful to have an appreciation for a variety of languages.

What are the system requirements for language c?

1. byte-organised memory (every bytes of the memory has to be accessible)

2. support for every ASCII characters (0-127)

How the new keyword allocates memory?

The new keyword in programming languages like C++ and Java allocates memory on the heap for an object or data structure. When new is called, it requests a block of memory sufficient to hold the specified type, initializes that memory (if applicable), and returns a pointer or reference to the newly allocated memory. This memory remains allocated until it is explicitly deallocated using delete in C++ or is automatically reclaimed by the garbage collector in languages like Java. Proper memory management is crucial to avoid memory leaks and ensure efficient use of resources.

What are variable length arrays in C99?

An array whose length is not known in compilation time.

int testfun (int n)

{

int varr [n];

...

}

it is ok in C99, invalid in earlier versions.

What is a special language used to write computer programs?

SQL which stands for Structured Query Language The term you are looking for is programming language.

How we can solve the equation for two or three unknown in C programming language?

Just as you would do it manually, I mean there is no predefined 'solve_equation' function in C.

What is getche command in c language?

There are no commands in C.
TurboC has got a function called getche, read the help (type into the editor: getche +)

What types of analyses use case study data?

Case studies are used for the following analyses: industry analysis; product/service analysis; financial analysis; and management analysis.

What is string library functions syntax?

String library function is one which is used to perform an operation in C-programming,without which library functions likestrlen(),strcp(),strcmp(),strdup(),strrev(),etc..,.can be performed

What is type equivalence in programming language?

Type equivalence occurs when two variables are of the same type. For example, if both variables are int (integer variables), they are of equal types. Equivalence can also occur with two different types that are compatible with each other.

What was the main function of the KGB?

the main fucntion was to kioll ishmael jenkins and all of his follers

What is C program execution life cycle?

C Program Development lifecycle!

C Program Development Cycle

A C program typically passes through four steps of development.

The solid lines show inputs into each step of the development cycle. Compile and Linkage Editor operations are performed by the C for AIX product, which also lets you specify what optional outputs are produced. Optional outputs are shown in the diagram by the broken lines. Descriptions of the steps follow below:

Design and Code

Involves designing a program to meet a specified requirement, and creating the programming language text files that will comprise the program source.

Compile

After checking for syntactical correctness, converts the programming language source files into machine readable instructions, where C variables are associated with memory addresses, and C statements are turned into a series of machine language instructions. The compiler can produces various forms of output, depending on the compiler options selected.

Linkage Editor

Links compiler output with external modules requested by the compiled program. C programs can use routines from C libraries or any object or archive file from the IBM XL family of languages. C programs can also use modules produced by the current or previous compilations. As well as linking the external modules, the linkage editor resolves addresses within the object module.

Run and Test

This stage can be both the final step in program development, or it can be an intermediate point in the program design and implementation process. A program's design commonly is further refined as a result of information gathered during testing.

Does Percentage belong to interval continuous data type?

Yes it is because it is a measurement of something usually entering into decimal figures and cannot be simply counted.

How do you solve autoit error subscript used with non-array variable?

A autoit error subscript means that a folder or subfolder cannot be found or registered. In order to fix this you either need to find a professional or edited the script to make sense so that the folder can be found.

Write abstract class in c plus plus?

An abstract class is any class definition that contains at least one pure-virtual function.

class AbstractClass

{

public:

virtual void DoSomething()=0; // Pure-virtual.

};

What is another name for bubble sort?

Bubble sort is also known as sinking sort.

What is database environment?

The database environment refers to the components inside a database. Some of these include hardware, software, data, as well as the procedures.

What is a c-code to implement heapsort?

Heapsort(A) {

BuildHeap(A)

for i <- length(A) downto 2 {

exchange A[1] <-> A[i]

heapsize <- heapsize -1

Heapify(A, 1)

}

BuildHeap(A) {

heapsize <- length(A)

for i <- floor( length/2 ) downto 1

Heapify(A, i)

}

Heapify(A, i) {

le <- left(i)

ri <- right(i)

if (le<=heapsize) and (A[le]>A[i])

largest <- le

else

largest <- i

if (ri<=heapsize) and (A[ri]>A[largest])

largest <- ri

if (largest != i) {

exchange A[i] <-> A[largest]

Heapify(A, largest)

}

}