Found 1401 Articles for C

What is Evaluation, Precedence and Association in C language?

Mandalika
Updated on 20-Feb-2021 05:17:24

3K+ Views

Expressions are evaluated by the ‘C’ compiler based on precedence and associativity rules.If an expression contains different priority operators, then the precedence rules are considered.Here, 10*2 is evaluated first since ‘*’ has more priority than ‘- ‘and ‘=’If an expression contains same priority, then associativity rules are considered i.e. left right (or right to left).

What are types of expressions evaluated in C Language?

Bhanu Priya
Updated on 11-Mar-2021 10:17:10

660 Views

An expression is a combination of operators and operands.Operand is a data item in which operation is performed.An operator performs an operation on dataFor example; z = 3+2*1       z = 5Types of expressionsThe different types of expressions that are evaluated in C language are as follows −Primary expressions − The operand in this expression can be a name, a constant or any parenthesized expression. For example, c = a+ (5*b);Postfix expressions − In a postfix expression, the operator will be after the operands. For example, ab+Prefix expressions − In a prefix expression, the operator is before the operand. ... Read More

What are primary data types in C language?

Bhanu Priya
Updated on 11-Mar-2021 10:16:24

8K+ Views

‘C’ compilers support four fundamental data types. They are as follows −IntegerCharacterFloating − pointDouble precision floating pointPrimary Data TypesIntegral data typeIntegral data types are used to store whole numbers and characters.It is further classified into two types −Integer data type.Character data type.Integer data typeThis data type is used to store whole numbers.The integer storage are short int, int and long int in both signed and unsigned forms.                                                                    ... Read More

What are the different computer languages?

Bhanu Priya
Updated on 11-Mar-2021 10:14:05

544 Views

The programming languages are used to give instructions to the computer in a language which a computer can understand.Computer languages are classified into three types as follows −Machine languagesSymbolic languagesHigh level languagesMachine languagesComputer is a machine. Since, its memory can store only 1’s and 0’s, instructions must be given to the computer in streams of 1’s and 0’s i.e. binary code.These are easily understandable by the machine.Programs written in binary code can be directly entered into computer for execution and it is known as machine language.Advantages of machine language include −Execution is very fast.It is very difficult to write and ... Read More

What is an algorithm and flowchart in C language?

Bhanu Priya
Updated on 11-Mar-2021 09:58:36

22K+ Views

Algorithm is a step – by – step procedure which is helpful in solving a problem. If, it is written in English like sentences then, it is called as ‘PSEUDO CODE’.Properties of an AlgorithmAn algorithm must possess the following five properties −InputOutputFinitenessDefinitenessEffectivenessExampleAlgorithm for finding the average of three numbers is as follows −StartRead 3 numbers a, b, cCompute sum = a+b+cCompute average = sum/3Print average valueStopFLOW CHARTDiagrammatic representation of an algorithm is called flow chart.Symbols used in flowchart are mentioned below −NameSymbolPurposeTerminalOvalstart/stop/begin/endInput/outputParallelogramInput/output of dataProcessRectangleAny processing to be performaed can be representedDecision boxDiamonDecision operation that determine which of the alternative paths ... Read More

State the importance of C language and its general structure

Bhanu Priya
Updated on 11-Mar-2021 08:36:53

6K+ Views

C programming is a general-purpose, procedural, imperative computer programming language.Importance of C LanguageC is called as a robust language, which has so many built-in functions and operations, which can be used to write any complex program.Generally, we use to call C as a middle level language. Because, the ‘C’ compiler combines the capabilities of an assembly language with the features of a high-level language. Therefore, it is best for writing both system software and business packages.‘C’ Programs are efficient and fast.C is highly portable, that is, ‘C’ programs written on one computer can be run on another with little (or) ... Read More

Differentiate the NULL pointer with Void pointer in C language

Bhanu Priya
Updated on 11-Mar-2021 08:18:06

10K+ Views

The difference between Null pointer and Void pointer is that Null pointer is a value and Void pointer is a type.NULL pointerA null pointer means it is not pointing to anything. If, there is no address that is assigned to a pointer, then set it to null.A pointer type, i.e., int *, char * each have a null pointer value.The syntax is as follows − * = NULL;For example, int *p = NULL; char *p = '\0';Example ProgramFollowing is the C program for NULL pointer − Live Demo#include int main(){    printf("TutorialPoint C Programming");    int *p = NULL; // ptr ... Read More

What happens if we include header file for two times in a C program?

Bhanu Priya
Updated on 11-Mar-2021 08:16:08

938 Views

C header files include some predefined functions. For example, printf() and scanf() functions are defined in the stdio.h header file.Each header files in C contains different predefined functions to make programs simple to understand.When a header file is included two times in a C program, the second one gets ignored. In actual, the #, called the include, preceding a header file ensures that it is included only once during the compilation process.Example 1Following is the C program for computing an average of three numbers − Live Demo#include #include //header file included twice ,ignored by compiler main(){    int a, b, c, ... Read More

What are the different searching techniques in C language?

Bhanu Priya
Updated on 11-Mar-2021 07:59:07

9K+ Views

Searching technique refers to finding a key element among the list of elements.If the given element is present in the list, then the searching process is said to be successful.If the given element is not present in the list, then the searching process is said to be unsuccessful.C language provides two types of searching techniques. They are as follows −Linear searchBinary searchLinear SearchSearching for the key element is done in a linear fashion.It is the simplest searching technique.It does not expect the list to be sorted.Limitation − It consumes more time and reduce the power of system.Input (i/p)Unsorted list of ... Read More

Explain the sorting techniques in C language

Bhanu Priya
Updated on 03-Jul-2024 14:53:05

31K+ Views

In this article, we are going to learn about the different sorting techniques and their implementations in C language. The following are the sorting techniques that we can implement with C language and other programming also: Bubble Sort Insertion Sort Selection Sort Merge Sort Shell Sort Heap Sort Bucket Sort Counting Sort Radix Sort Quick Sort Bubble Sort using C Bubble Sort is an elementary sorting algorithm, which works by repeatedly exchanging adjacent elements, if necessary. When no exchanges are required, the file is sorted. Example of Bubble Sort using C #include void bubbleSort(int array[], ... Read More

Advertisements