c language tutorial

Pointers in C Languagelearn c language,study c language,c language tutorial

Introduction, declaration,  applications, Pointers in C are easy and fun to learn. Some C programming tasks are performed more easily with pointers, and other tasks, such as dynamic memory allocation, cannot be performed without using pointers. So it becomes necessary to learn pointers to become a perfect C programmer. Let’s start learning them in simple […]

Notion of order of complexity in C Language

Asymptotic Notation Asymptotic complexity is a way of expressing the cost of an algorithm using idealized units of computational work. In order to choose the best algorithm for a task many factors, like how long will it take for an algorithm to run or how much memory will be taken by the algorithm during running, […]

Finding roots of equations in C Language

#include <math.h> #include <stdio.h> int main() { float a, b, c, discriminant, root1, root2, realPart, imagPart; printf(“Enter coefficients a: “); scanf(“%f”, &a); printf(“Enter coefficients b: “); scanf(“%f”, &b); printf(“Enter coefficients c: “); scanf(“%f”, &c); discriminant = b * b – 4 * a * c; // condition for real and different roots if (discriminant > […]

Sorting in C Language

Basic Sorting Algorithms (Bubble, Insertion and Selection),

Searching in C Language

Searching in C Language has to check for an element or retrieve an element from any data structure where the data is stored. Based on the type of search operation, there are generally two algorithms defined in C:
1- Linear Search or Sequential Search, 2- Binary Search

Passing arrays to functions in C Language

If you want to pass a single-dimension array as an argument in a function, you would have to declare a formal parameter in one of following three ways and all three declaration methods produce similar results because each tells the compiler that an integer pointer is going to be received. Similarly, you can pass multi-dimensional […]

Array of structures in C Language

Pointers to Structures You can define pointers to structures in the same way as you define pointer to any other variable − struct Books *struct_pointer; Now, you can store the address of a structure variable in the above defined pointer variable. To find the address of a structure variable, place the ‘&’; operator before the […]

Enumerated data types in C Language

The enumerated data type gives us an opportunity to invent our own data type and define what values the variable of this data type can take. This can help in making the program listings more readable, which can be an advantage when a program gets complicated when more than one programmer would be working on […]

Union in C Language

A union is a special data type available in C that allows to store different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose. […]

Structure in C Language

Arrays allow to define type of variables that can hold several data items of the same kind. Similarly structure is another user defined data type available in C that allows to combine data items of different kinds. Structures are used to represent a record. Suppose you want to keep track of your books in a […]

1 6 7 8 9 10 13