allocated in some other program and that address will be given to the Check C Aptitude Questions for more C Aptitude. Interview . PDF Online. PhoneFavs. C Programming questions and answers with explanation for interview, freshers can download C Programming quiz questions with answers as PDF files and. C Aptitude Questions and Answers in pdf with multiple choice and C language is the most common and general purpose programming language available.

Language:English, Spanish, Arabic
Country:Saudi Arabia
Published (Last):05.10.2015
Distribution:Free* [*Registration needed]
Uploaded by: MELODY

56475 downloads 159280 Views 19.74MB PDF Size Report

C Language Aptitude Questions Pdf

Students3k provides free PDF download for “Technical aptitude questions in c“. This file has solved C aptitude questions with answers PDF. C aptitude. In view of this, the proposed book aims at providing understanding of C language in a very simple way in the form of short aptitude questions. C Programming Aptitude Questions and Answers (Multi Choice Questions - MCQ ) – Aptitude Questions and Answers in C programming Language on various.

Ask a Question. As we know that C language is very popular and widely used programming languages, here we are starting practicing aptitude in C language. This section contains C Aptitude Questions with Answers and Explanation, each aptitude question has 4 answers in which one answer is correct you have to choose correct answer by clicking on that. As we know C programming language is the first language to learn and it is also important, popular computer programming language, it is a middle level language useful for both low level hardware level and high level user applications programming. C programming Aptitude Questions and Answers are required to get selected in any technical developer job, if you are a computer science student or working professional in the same field, you have to learn deeply about computer programming.

Here is collection of lot of programs in c language. These questions are Multiple Choice Questions and Answers MCQ type, each question has multiple answers, in which one answer is correct, you have to choose correct answer. Questions also have answer with explanations.

Comments and Discussions. Are you a blogger? Join our Blogging forum. A humble request Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website. Subscribe Ask a Question. Comments and Discussions Ad: Embedded C Interview Q. Computer G. MCQ Most viewed pages It is used to assign a value to a given variable. The modulus operator outputs the remainder of a division.

For example: A nested loop is a loop that runs within another loop.

Put it in another sense, you have an inner loop that is inside an outer loop. In this scenario, the inner loop is performed a number of times as specified by the outer loop. For each turn on the outer loop, the inner loop is first performed. Instead, the operator! Compilers and interpreters often deal with how program codes are executed.

Interpreters execute program codes one line at a time, while compilers take the program as a whole and convert it into object code, before executing it. The key difference here is that in the case of interpreters, a program may encounter syntax errors in the middle of execution, and will stop from there.

On the other hand, compilers check the syntax of the entire program and will only proceed to execution when no syntax errors are found. The char keyword can only hold 1 character value at a time. By creating an array of characters, you can store string values in it. While curly brackets are mainly used to group several lines of codes, it will still work without error if you used it for a single line. Some programmers prefer this method as a way of organizing codes to make it look clearer, especially in conditional statements.

Header files are also known as library files. They contain two essential things: Simply put, commands that you use in C programming are actually functions that are defined from within each header files. Each header file contains a set of functions. Syntax errors are associated with mistakes in the use of a programming language. It maybe a command that was misspelled or a command that must was entered in lowercase mode but was instead entered with an upper case character. A misplaced symbol, or lack of symbol, somewhere within a line of code can also lead to syntax error.

Variables and constants may at first look similar in a sense that both are identifiers made up of one character or more characters letters, numbers and a few allowable symbols. Both will also hold a particular value.

Values held by a variable can be altered throughout the program, and can be used in most operations and computations. Constants are given values at one time only, placed at the beginning of a program. This value is not altered in the program. For example, you can assigned a constant named PI and give it a value 3.

You can then use it as PI in the program, instead of having to write 3. Arrays contain a number of elements, depending on the size you gave it during variable declaration.

Each element is assigned a number from 0 to number of elements To assign or retrieve the value of a particular element, refer to the element number. Since each header file contains different function definitions and prototype, you would be using only those header files that would contain the functions you will need.

Declaring all header files in every program would only increase the overall file size and load of the program, and is not considered a good programming style.

When declaring functions, you will decide whether that function would be returning a value or not. Compound statements are made up of two or more program statements that are executed together. Compound statements can also be executed within a loop. Before a program can be written, an algorithm has to be created first. An algorithm provides a step by step procedure on how a solution can be derived. It also acts as a blueprint on how a program will start and end, including what process and computations are involved.

When storing multiple related data, it is a good idea to use arrays. This is because arrays are named using only 1 word followed by an element number.

Technical Aptitude questions in C programming [PDF]

With arrays, only 1 name is used, the rest are accessible through the index name grade[0], grade[1], grade[2]… grade[9]. This is a common mistake for programmers, often leading to logical errors. Random numbers are generated in C using the rand command. The most probable reason behind this error is that the header file for that function was not indicated at the top of the program. Header files contain the definition and prototype for functions and commands used in a C program.

Comments are a great way to put some remarks or description in a program. It can serves as a reminder on what the program is all about, or a description on why a certain code or function was placed there in the first place. Comments can be a single line, or can even span several lines.

It can be placed anywhere in the program. Debugging is the process of identifying errors within a program. During program compilation, errors that are found will stop the program from executing completely. At this state, the programmer would look into the possible portions where the error occurred.

Debugging ensures the removal of errors, and plays an important role in ensuring that the expected program output is met. When using this operator, all conditions specified must be TRUE before the next action can be performed.

There is no single command or function in C that can check if a number is odd or even. However, this can be accomplished by dividing that number by 2, then checking the remainder. If the remainder is 0, then that number is even, otherwise, it is odd.

You can write it in code as:. This format is used for two things: The number before the decimal point is for the allotted space, in this case it would allot 10 spaces for the output number. If the number of space occupied by the output number is less than 10, addition space characters will be inserted before the actual output number.

Program that contains logical errors tend to pass the compilation process, but the resulting output may not be the expected one. This happens when a wrong formula was inserted into the code, or a wrong sequence of commands was performed. Syntax errors, on the other hand, deal with incorrect commands that are misspelled or not recognized by the compiler.

There are 3 main control structures in programming: Sequence, Selection and Repetition. Sequential control follows a top to bottom flow in executing a program, such that step 1 is first perform, followed by step 2, all the way until the last step is performed.

This also means that not all codes may be executed, and there are alternative flows within.

C Programming Questions and Answers

Repetitions are also known as loop structures, and will repeat one or two program statements set by a counter. The is also known as the OR operator in C programming. For comparing string values, there is another function called strcmp that deals specifically with strings. Preprocessor directives are placed at the beginning of every C program.

This is where library files are specified, which would depend on what functions are to be used in the program. Another use of preprocessor directives is the declaration of constants. Preprocessor directives begin with the symbol. The outcome will be TRUE. Just the same, s! Order of precedence determines which operation must first take place in an operation statement or conditional statement. On the top most level of precedence are the unary operators!

Instead, use the strcpy function. The correct statement would be: To get the length of a string value, use the function strlen. For example, if you have a variable named FullName, you can get the length of the stored string value by using this statement: This is because C language is rich in features that make it behave like a high level language while at the same time can interact with hardware using low level methods. The use of a well structured approach to programming, coupled with English-like words used in functions, makes it act as a high level language.

On the other hand, C can directly access memory structures similar to assembly language routines. Source codes in C are saved with. C file extension. Header files or library files have the. H file extension.

Every time a program source code is successfully compiled, it creates an. OBJ object file, and an executable. EXE file. Reserved words are words that are part of the standard C language library.

This means that reserved words have special meaning and therefore cannot be used for purposes other than what it is originally intended for. Examples of reserved words are int, void, and return. A linked list is composed of nodes that are connected with another. In C programming, linked lists are created using pointers. Using linked lists is one efficient way of utilizing memory for storage.

C Programming Questions and Answers

In C programming, there is a data structure known as queue. A queue represents a line wherein the first data that was stored will be the first one that is accessible as well. Binary trees are actually an extension of the concept of linked lists.

A binary tree has two pointers, a left one and a right one. Each side can further branch to form additional nodes, which each node having two pointers as well. All reserved words must be written in lowercase; otherwise the C compiler would interpret this as unidentified and invalid.

In the first expression, the increment would happen first on variable a, and the resulting value will be the one to be used. This is also known as a prefix increment.

In the second expression, the current value of variable a would the one to be used in an operation, before the value of a itself is incremented. This is also known as postfix increment. C language is a case sensitive language. An endless loop can mean two things. One is that it was designed to loop continuously until the condition within the loop is met, after which a break function would cause the program to step out of the loop. Another idea of an endless loop is when an incorrect loop condition was written, causing the loop to run erroneously forever.

Endless loops are oftentimes referred to as infinite loops. A flowchart provides a visual representation of the step by step procedure towards solving a given problem.

Related articles:

Copyright © 2019 All rights reserved.
DMCA |Contact Us