C Question and Answer


In C we can construct in two ways. One is increment operator ++ and other is decrement operator -. For example, if the statement "i++" means is to increment the value of i by 1 where "i --" helps to decrement the value of i by 1. The other way to write the increment statements is used to conventional + plus sign or - minus sign. In the case of "i++," the way to write is "i=i+1."

 

The address of the variables is passed as arguments to the function in Pass By Reference method. The value of the variables is passed as arguments to the function in Pass By Value method.
In the memory stack, no variable is created A copy of the original variables is formed in the memory stack.
No pointers are used in the call by value approach. The pointers are used in the call by reference approach.
The pass by reference method creates only a single copy, thereby, providing memory efficiency. Call by values is not memory efficient. It approach to creates two or more copies of the original variables.

In a program placing comment symbols /* */ around the code is referred to as " commenting out," it is the way of isolating the few codes that you think, and it may cause errors in the program, without deleting the errors. The reason is that is the code is a factually correct, you simply remove the comment symbol and continue. It would save the time and effort on having to retype the code if you deleted in the first place.

The stack is also a data structure. The stack is an order of collection of items where the addition of new items and the removal of existing items always keeps at the end. The data is stored in the stack by using First In Last Out (FILO). In the same way if any particular instance the only stack is accessible. Which means the order is to retrieve the data to store inside the stack. The data what is stored in the stack is also referred to PUSH, while the data retrieval used as POP.

In a file when we are writing a program that will store and retrieve the data, and it is possible to designate the file into different forms. In a sequential access file, the data is saved in the form of sequential order so that one data is placed into the file after another. The information has to read one input at a time until the right one is reached to access a particular data within the sequential access file.

In a program, the variable is assigned an initial value before it is used to refer the process. It may have unknown value without initializing a variable If we used in computations or other operations that can lead to unpredictable outputs.

The Spaghetti program will make to analyze the coding difficulty and a program very complex, and it must be avoided as much as possible. It will refer the code which tends and to gets tangled and overlapped by the program. The unstructured approach for the coding it will usually attribute for the lack of experience on the part of the programmer.

 

Source Code is In the form of Text It is stored in the form of Binary Numbers.
The Source Code is Generated on the form of Human or Programmer Object Code is Generated by Compiler
The source code is the Human Readable Code Object Code is in Machine Readable formats.
The source code is received Compiler as an Input Object Code is Generated by Compiler as an Output.

In C programming language to insert the quote character is a part of output which can be used the format of specifiers \’ (for single quote), and \” (for double quote). It is a common problem for beginners because quotes are usually a part of printf statement in a programming language.

The void keyword will decide whether the function would be returning the value or not. In the function, it returns a value in that purpose function will display some outputs in a screen. Then “void” is placed at the leftmost part of a function header. Moreover the value return, it is placed instead of void after the function execution.


The compound statements are made up of two or more program statements which are executed together. There are usually occurs while handling the condition in a series of a statement which is performed when TRUE or FALSE is evaluate. They will also run within a loop. Therefore the curly brackets{ } will be placed before and after compound statements.

An algorithm is a blueprint of a program in how a program will start and end. Including how the process and computation are involved. An algorithm has to be created first before starting a program. A step by step procedure can be derived in how the solution can be solved.

The arrays are named using only one word followed by different element numbers. When we store multiple related data, it is a good idea to use arrays. For example: to store 10 test results of 1 student, and one can use ten different variable names like (grade1, grade2, grade3… grade10). In arrays, only 1 names are used and remaining are accessible through the index name (grade[0], grade[1], grade[2]… grade[9]).

We can do by using %% in printf statement. For example, we can write printf(“10%%”) to have the output appear as 10% on the screen.

By Using fseek() function key to perform random access input/output on file. When the file was opened to insert the key as fopen(), then fseek would require three parameters to work on: a file pointer to the file, the number of bytes to examine, and the point of source in the file.

No, comments were come across by the compiler are overlooked. Comments are mostly for the supervision of the programmer only and do not have any other significant use of the program functionality.

Yes, use the qsort() function. It is also probable to make user-defined functions for arranging, such as those based on the expand sort and bubble sort algorithm.

Storing data on the heap is the method is inefficient for the large database as its take much time to search/modify and slower than it would take when using the stack. However, it is good in fast technique and well guarantees with flexibility as well. Heapsort algorithm was well designed and widely used because of its efficiency.

You can convert strings to numbers by a method on your own functions to do string to number conversions, or by using C’s built-in functions. Also, You can use to convert to an integer value, to convert to a long integer value, and of to convert to a floating point value.

It helps to do with the parsing process and the compilation of the code. A semicolon (;) acts as a delimiter, so it indicates the compiler where each statement ends and it can proceed to divide the statement into smaller elements for syntax checking.

‘\0’ character is used primarily to show the end of a string value. This is used to refer to as a terminating by null character.

A = symbol is used in the mathematical operations. And it also used to assign the values to a given variable. On the other hand, the == symbol is known as “equal to” or “equivalent to.” It is a relational operator which is used to compare the two values.

Module operator outputs are the remainder of a division. It will make the use of percentages (%) symbol. For example, 10 % 3 = 1, meaning when we divide ten by 3, then the remainder is 1.

The nested loop is a loop which runs within the other loop. But in another sense, it will have an inner loop which is inside the outer loop. In the same way, the inner loop is also performed sometimes as specified by the outer loop. For each turn, the inner and outer loop executes first.

In programming language <> is the wrong operator. While writing a conditional statement is correctly interpreted as " not equal to ." And it is not an operator to be used in C Programming. Instead of the operator != will be used to indicate "not equal to."

The compilers and interpreters often deal with how the program codes are executed. A compiler will take the program as a whole and convert into object code before executing it. But interpreters run the program code one line at a time. The compiler will check the syntax of the entire program and will only proceed to execution when no syntax errors found. Whereas in interpreters a program may encounter syntax errors in the middle of line execution and it will stop from there.

In a string value, the char keyword can only hold one character value at a time. So by creating an array of characters, we can store string values in it. Example: “char ch[50]; ” declares a string variable named ch that can hold a maximum of 50 characters.

In a program, curly brackets are initially used for the group of several lines of codes, And it will still work without error for a single line. In some program this method it will prefer the way of organizing the codes to make it looks decidedly clearer, Mainly in conditional statements.

In a programming language, Syntax errors are associated with mistakes. It can have a command that was misspelled or a command which should be entered in the lowercase bust was not instead entered with an upper case character. A misplaced symbol, or lack of symbol, somewhere within a line of code which also leads to the syntax error.


Variables and constants may have the first look similar in the sense of both identifiers made up of one or more characters (letters, numbers and a few allowable symbols). In a programming language, both will also hold a particular value. In some program, the values held by a variable which can be altered through the execution and it can use in most of the operations and computations. For example, you can assign a constant named PI and given it a value 3.1415. So in the program, PI can use instead of having to write as 3.1415 in each time we need it.

During a variable declaration, Array contains some elements, depending on the size of a variable. Each element is assigned a number 0 to elements of number -1. To retrieve the value of a particular element we refer to the element number. For example: If we declare “intscores[5];” then we have 5 accessible elements, like scores[0], scores[1], scores[2], scores[3] and scores[4].

No “int” data type is capable of storing the values from -32768 to 32767. Hence to store the value of 32768, we can use “long int” instead of it. In the same way, we can use “unsigned int,” assume that we don’t intend to store negative values.

Yes, If the need arises it perfectly valid to combine operators. For example, We can have code like ” printf (“Hello\n\n\’Welcome\'”) ” to the output text “Hello” in the first line and the next two lines after “Welcome” will appear.

In C programming language the choice of declaring a header file would depend on what the commands/functions will be using in the program. However, each header file contains many different functions definition and prototype by using only those header files in the service. By adding the header files in a program, it may increase the overall file size and load to the program it would not consider a good programming style.

YES! it is possible to create our own header files. It needs to include a function protocol which is used in our program and has used the #include command followed by its name of our header file.

Storing of data more efficiently into memory is delivered by a Dynamic data structure. Using it dynamically stored data, your program will be entrée memory spaces as per need.

The different data types of C is int, char, and float. int is used to insert the variables that will store integer values. For storing real numbers, Float C type is applied. For storing character values, Char C type is applied.

In C program begins with the preprocessor directives, in which the programmer would specify which header file and what constants (if any) to be used. This is followed by the main function heading. Within the primary function lies the variable declaration and program statement.

When a stored data file is large at the same time the random access file is can be used randomly which allow you to search through and quicker. The random access file can take you to the target address where data is stored. If a file is sequentially placed, then you have to go through one record at a time until you reach target data.

If a break statement is omitted, then It will move on to the next case portion, possibly causing incorrect output.

Yes, it can be possible to pass an entire structure to a function in a call by a process called method style. However, some programmers prefer declaring the structure universally, then pass a variable of that structure type to a function. This method helps maintain dependability and consistency regarding argument type.

The use where he gets full line data entry is called the gets(). When an input is given as entering by a user then the entire line of characters is stored to string variables. Whereas the enter key is not included in the variable, but instead, a null terminator \0 is placed after the last character

In C programming the header files are known as library files. In that, they contain two essential so the definitions and prototype of functions being used in a program. Each header file includes a set of function in a programming language. For example, stdio.h is the header file which contains the definition and prototypes of the commands.

Manipulated and can be accessed anywhere in the program by variables called global variables. Placing the variable declaration on the upper portion of the program can make a variable global with directives section of a preprocessor.

The Values of a variable can make more meaningful by enumerated types to allow the programmer. Each type variable is associated with a numeric code. Example enumerated type variable is like named as DAYS and values would be Monday, Tuesday Wednesday….Sunday.

Converting any letter to its uppercase mode is called toupper(). The function for toupper() is in . This Function will only convert a single character and not complete string.

Yes, that is accessed in C programming. We just need to insert the complete function prototype into a parameter field of another function where it can be used.

Storing data of Multidimensional arrays in a two or more dimensional structure. An Example, we use a 2-dimensional array to store the present position of pieces in a chess game, or position of players in a tic-tac-toe program.

In C language strcat() function helps to append string. Which it takes two parameters, the source string, and the string value to be appended to the source string.

Each Function will access a character input value by the user. While using getch(), the key which Enter will not appears on display and is captured automatically to assign a variable. When using it(), the key function that was entered by the user will be displayed on a screen and also assigned to variable simultaneously.

Yes, this both make the same thing, which is to accept the next key function entered by a user and assign it to a variable named letter.

The Stored Records which are used primarily as structure types. And its related fields which record is Made. It makes Easier to Organize a group related data.

In C program “r” means ‘read’ and ‘w’ means to write. And ‘w’ uses to open a file to output and previous data will be erased which already been stored.


Computers can be understood only the language with binary digits/files which denotes from 1s and 0s only and that all make for commutating the data from input to output display(digital to analog) whereas humans can be easily understood the text files which includes a letter, numbers, and other symbols.

User-defined variables are the reserved words, and same cannot be utilized, and similarly, Void is also reserved word in the c programming language.

Passing information with calling programs to a called utilities to act on given values and need to send those assigned values to that function. Values which are sent to the called utilities are meant to be actual arguments.

Character or single quotation mark, or individual other characters in character constant, will be represented NEWLINE. In the output screen data when its displaying is used to place the new line. More. In computing terminology also called line ending or end of the line (EOL) or line break. The \n character always represents a new line escape sequence.

Rightward pointing angular symbol (>) is output redirection which Is used to redirect the file to Function standard output. For example, if you have a command to save the file to print then the data will be written and saved to a device like a printer to print the data output.

An error occurs when the program is running called as run-time errors example if you are dividing a numeric number of any digits with zero. It mostly occurs when the program is executed, and same will be a pause or shows highlighted dialogue box into error.

Abs() and fabs() functions similar performance/action which is to get the actual value of a given value. Integer values used by Abs() and floating type numbers used by fabs().

The function which passed the values in formal parameters in C program. Whatever operations are indicated in the main body in formal parameters where values are substituted.

The instruction which is to be performed in a program by a control structure take charge. Which means the program flow no need to move from one proclamation to the next one, but some of the portions may be bypassed from the outcome of depending conditional statements.

Passing a single array element or entire array can be given to a function in programming as a single element of an array can be passed in the same manner as passing variables to a function by one dimensional/multi-dimensional array.

Pointers contains the address of a variable, which contains a value or even an address to another memory. Pointers point to specific areas in the memory.

The ampersand & symbol should be placed on the variable name and number. Whatever an integer value is entered by using the address and user stores the variable name. And there is a common mistake for the programmer often leading to logical errors.

In C Random numbers are generated by using rand() command. For example, anyNum = rand() is generated any integer number is beginning from 0, assume that anyNum is a variable of type integer.

In a C program Header files contain the definition and prototype for the functions and command. In the program, the probable reasons behind the error are that the header file for the functions will be indicated at the top. In the case of “tolower()”, the code “#include ” will be present at the beginning of the program.

In a program comments are a great way to put some description or remarks. In the first place, it can serve as a reminder of what the program is all about or an explanation on why a specific code or function was placed there. They will begin with /* and ended with */ characters. And comments will be in a single line or can even span in several lines and can place anywhere.

In a program debugging is the process of identifying errors. At the time of program compilation, errors will found and stop the program from execution completely. At this stage, the programmer will look into the possible portions where the error occurs. It ensures the removal of errors and plays an essential role in providing the expected program output.

The AND operator is referred to as && Symbol. While using this operator, all the condition statements specified must be TRUE before the next action will be performed. Suppose if you have ten conditions but one condition fails to evaluate as TRUE, and the entire condition statement is already evaluated as FALSE.

In C programming language order of precedence determines which operation should first take place in any operation statement or a conditional statement. In the topmost level, the precedence is the unary operators! +, - and &. Hence it is followed by the regular mathematical operators (*, / and modulus % first, followed by + and -). And the relational operators are the next line <, <=, >= and >. It is followed by two equality operators == and!=. Then followed by the logical operators && and ||.

We cannot use the = sign to assign the values to a string variable. So that we use strcpy function. The correct statement would be strcpy (myName, “Robin”);

In a variable to get the length of a string value using the function strlen(). For example, if you have variable name FullName, can get the length of the stored string value. Hence by using this statement: I= strlen(FullName); the variable

Yes! To separate the assignment statement after the variable declaration, you don't want to write unless you plan to change. For example char planet[15] = “Earth”; does two things: it declares a string variable named a planet, then initializes.

The statement is True and Valid that INT = 10.50. Most of the reserved words are in lowercase and case sensitive and C compiler will be given access to the reserved word as well. Similarly, if assume that INT is reserved word which is universal same and cannot be replaced in programming by any user.

A switch statement can be assessed only character data and integer type and where a switch statement is distributed with selected single variable or expression.

In C language is rich in features which makes to behave like a high-level language while at the same time can interact with hardware by using low-level methods. On other hands, C can directly access memory structures which are similar to assembly language.


In C Source codes are saved with a .C file extension. In Header files or library files have the .H file extension. In a program, every time source code is successfully compiled when. OBJ object-file, and an executable. EXE file.

It’s a definition of programming language which been reserved identification words which can’t be redefined by programmer/programming form anything but an identification word for the programming language to be easily and universal unique words. For example of defined or reserved words are int, void, Print and return.

A linked list or linear set of elements which is also called as Nodes which stores each relevant elements location and address link part of previous element/node. A data structure of different elements/nodes by physical placement in memory for storage. Where each element points to next.

FIFO may refer to First in, first out. FIFO (computing and electronics) is a programming language, a method of queuing or memory management. In other words, the value relevant to the inventory that was purchased first is the cost incurred first.

A binary tree is a tree data structure in which each node has at most two elements, which are referred to as the left element and the right element. It means a representation of a data structure which is linked to a group of lists.

FALSE! Because compiler will be interrupted as unidentified and void. All reserved words are always In lowercases and case sensitive

Postfix and prefix increment are the two variables for given expressions a++ and ++a. a++ post-increment value increased by 1 and ++a pre-increment value increased by 1.evaluate the difference on the increment would happen first on variable

z+=15 is like free method which can write it as z=z+15, so the first value of z is 5, then 5 +15=20.

False. C language is a case-sensitive process For constructing the variable name of the identifier can't be same both are three different unique variables (NAME, name, and Name)

The endless loop is also called infinite loop where a program is endless which either due to loop can’t be terminated. The infinite loops always affect the program to consume all available processor time, but can usually be terminated by the user. When an infinite loop occurs in the condition it will never be met, due to some inherent characteristic for the endless loop.

Program flowchart is a process which shows a set of protocol with its work-flow of antilogarithm. This can be done by the steps as boxes of various arrows represents diagrammatically. In each step, it shows the particular program structure of this process, condition and input/output phase of a program.




Onlinetpoint is optimized for basic learning, practice and more. Examples are well checked and working examples available on this website but we can't give assurity for 100% correctness of all the content. This site under copyright content belongs to Onlinetpoint. You agree to have read and accepted our terms of use, cookie and privacy policy.