
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1339 Articles for C

2K+ Views
String Searching Functions The C string functions are built-in functions used for various operations and manipulations on strings. These functions perform tasks such as copying, comparing, concatenation, and determining the length of strings. The library also provides several string-searching functions, which are included as follows − Function Description ... Read More

1K+ Views
The library #include contains the basic memory operations. Although not strictly string functions, the functions are prototyped in #include . These memory operations are as follows − void *memchr (void *s, int c, size_t n); Search for a character in a buffer. int memcmp (void *s1, void *s2, size_t n); Compare two buffers. ... Read More

14K+ Views
In C programming language, several directives control the selective compilation of different parts of the program code. Conditional Compilation is a set of preprocessing directives that allows us to exclude and include parts of a program based on specified conditions. Each directive in the compilation is processed across different platforms, including debug and release versions. They are as follows − #if #else #elif #endif The "#if" Directory The #if is a directive preprocessor that evaluates the expression or condition. If the condition ... Read More

338 Views
The major differences between an array and a structure in C programming language are as follows −ArraysStructuresAn array is a single entity representing a collection of data items of same data types.A structure is a single entity representing a collection of data items of different data types.Individual entries in an array are called elements.Individual entries in a structure are called members.An array declaration reserves enough memory space for its elements.The structure definition reserves enough memory space for its members.There is no keyword to represent arrays but the square braces [] preceding the variable name tells us that we are dealing ... Read More

9K+ Views
Structure is a collection of different datatype variables, grouped together under a single name.Features of structureThe features of structure in the C programming language are as follows −It is possible to copy the contents of all the structure elements of different datatypes to another structure variable of its type by using an assignment operator.For handling the complex datatypes, it is better to create structure within another structure, which is called nested structures.It is possible to pass an entire structure, individual elements of structure and an address of structure to a function.It is possible to create structure pointers.ProgramFollowing is the C ... Read More

5K+ Views
Structure is a collection of different datatype variables, grouped together under a single name.Features of structureThe features of structure in the C programming language are as follows −It is possible to copy the contents of all the structure elements of different datatypes to another structure variable of its type by using an assignment operator.For handling the complex datatypes, it is better to create structure within another structure, which is called nested structures.It is possible to pass an entire structure, individual elements of structure and an address of structure to a function.It is possible to create structure pointers.Declaration and initialization of ... Read More

3K+ Views
The user has to enter the order of two matrices and elements of two matrices. Then, these two matrix are compared.If both matrix elements and size are equal, then it displays that the two matrices are equal.If size of matrix is equal but the elements are not equal, then it displays that the matrix can be compared but is not equal.If the size and elements are not matched, then it displays that the matrices cannot be compared.ProgramFollowing is the C program to compare if the two matrices are equal or not −#include #include main(){ int A[10][10], B[10][10]; ... Read More

5K+ Views
ProblemWrite a code to sort all the rows of matrix in an ascending order and all columns in the descending order. The size of matrix and elements of matrix are given by user at runtime.SolutionThe solution to sort all the rows of matrix in an ascending order and all columns in the descending order in the C programming language is explained below −The logic used to sort the rows in an ascending order is as follows −for (i=0;i

1K+ Views
ProblemWe need to write a code to interchange the main diagonal elements with the secondary diagonal elements. The size of the matrix is given at runtime.If the size of matrix m and n values are not equal, then it prints that the given matrix is not a square.Only a square matrix can interchange the main diagonal elements and can interchange with the secondary diagonal elements.SolutionThe solution to write a C program to interchange the diagonal elements in given matrix is as follows −The logic to interchange the diagonal elements is explained below −for (i=0;i

827 Views
ProblemWrite a program to accept a one-dimensional array of N elements and split into two halves. Later on, sort the first half in an ascending order and the second half into descending order.SolutionThe solution to perform the two operations on two halves’ in a single array in C programming language is explained below −The logic used to sort the first half in an ascending order is as follows −for (i=0; i