You can find good C questions in the following C language quizzes:
C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. C has won widespread acceptance because it gives programmers precise control and efficiency to the programmer. Programmers who are familiar with the use of pointers (or indirect addressing) will welcome the ease of use compared with some other languages. In C, all executable code is contained within functions. Function parameters are always passed by value. Pass-by-reference is achieved in C by explicitly passing pointer values. C is block structured, and designed for procedural and imperative programming. Although C was designed for implementing system software, it is also widely used for developing application software. C has now become a widely used professional language for various reasons: C is an easy language to learn, it has high-level constructs, it can handle low-level activities, it produces efficient programs and it can be compiled on a variety of computers.
It is hoped that newcomers will find C a useful and friendly language.
Below is a list of C's characteristics that define the language and also have lead to its popularity as a programming language.
This means that once you write your C program, you must run it through a C compiler to turn your program into an executable that the computer can run (execute). This means that to write and run a C program, you must have access to a C compiler. C language was designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal runtime support. C was therefore useful for many applications that had formerly been coded in assembly language. It is widely used on a great many different software platforms and computer architectures, and several popular compilers exist. C has greatly influenced many other popular programming languages, most notably C++, which originally began as an extension to C. Despite its low-level capabilities, C language was designed to encourage machine-independent programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with little or no change to its source code. The language has become available on a very wide range of platforms, from embedded micro controllers to supercomputers.
Its main drawback is that it has poor error detection which can make it unappealing to the beginner. However, by knowing the rules of C one can break them. This if done properly and carefully leads to the power of C programming. The fact that C is a bit more terse and cryptic in its style than some other languages can result in short efficient programs but also allows the programmer to produce programs which are impossible to understand. Care must be taken in using C. Many of the extra facilities which it offers can lead to extra types of programming error (Undisciplined use of pointers can lead to errors which are very hard to trace). One will have to learn to deal with these to successfully being a good C programmer.
Undefined behavior indicates that an implementation may behave unpredictably when a program reaches a certain state, which almost without exception is a result of a bug. Undefined behavior is always undesirable and should never occur. Sometimes in practice what happens for an instance of undefined behavior is a bug that is hard to track down and which may corrupt the contents of memory. Examples of undefined behavior are:
Unspecified behavior, on the other hand, is a feature that means that the specification leaves intentionally unspecified the results of certain operations to simplify the specification and allow some flexibility in implementation. It is guaranteed that the behavior of a certain implementation in such cases is consistent on the same machine. It is not guaranteed, however, that the behavior will preserve on another machine. Unspecified behavior is usually something you shouldn't worry about, unless your software is required to be portable. Examples of unspecified behavior are:
In C, even the compiler is not bound to behave in a sensible manner once Unspecified behavior or Undefined behavior has been invoked. The reason some behavior has been left unspecified is to allow compilers for a wide variety of instruction set architectures to generate more efficient executable code for well-defined behavior, which was deemed important for C's primary role as a systems implementation language; thus C makes it the programmer's responsibility to avoid unspecified behavior. Many programming languages has undefined and unspecified behaviors. By learning and knowing these behaviors the programmer can write stable and efficient programs.
An array lets you declare and work with a collection of values of the same type. For example, you might want to create a collection of seven integers. The seven separate integers inside this array are accessed by an index. All arrays start at index zero and go to n-1 in C.
C supports the use of pointers, a very simple type of reference that records, in effect, the address or location of an object or function in memory. C pointers are characterized by their value and data-type.The value is the address of the memory location the pointer points to and the type determines how the pointer will be incremented/decremented in pointer arithmetic.
C uses pointers in three different ways:
In some cases, C programmers also use pointers because they make the code slightly more efficient.
The concept of array is very much bound to the one of pointer. In fact, the identifier of an array is equivalent to the address of its first element, as a pointer is equivalent to the address of the first element that it points to, so in fact they are the same concept. However, there is a distinction to be made between arrays and pointer variables. Even though the name of an array is in most expression contexts converted to a pointer (to its first element), this pointer does not itself occupy any storage. Consequently, you cannot change what an array "points to", and it is impossible to assign to an array.
Test your programming knowledge with our C language programming quizzes. Don't forget to bookmark this site and check back for user generated frequent updates. Here, in this category, you can test your C language understanding. You can view other users answers, explains and questions discussions. In addition you can participate in the discussions or contribute your own c language questions.
You can now sign up to be notified of changes, add new quizzes, discuss quizzes or improve existing !