
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

852 Views
ProblemLet’s create a simplified expression by removing brackets from the expressions.SolutionExample 1Input: A string expression with bracket is as follows: (x+y)+(z+q) The output is as follows: x+y+z+qExample 2The input is as follows: (x-y+z)-p+q The output is as follows: x-y+z-p+qAlgorithmRefer an algorithm to remove the brackets from a given input.Step 1: Declare and read the input at runtime.Step 2: Traverse the string.Step 3: Copy each element of the input string into new string.Step 4: If anyone parenthesis is encountered as an element, replace it with empty space.ExampleFollowing is the C program to remove the brackets from a given input −#include int ... Read More

15K+ Views
ProblemWrite a C program to search an element from an array at runtime by the user and the result to be displayed on the screen after search. If the searching element is not in an array then, we need to search element is not found.SolutionAn array is used to hold the group of common elements under one nameThe array operations are as follows −InsertDeleteSearchAlgorithmRefer an algorithm to search the elements into an array with the help of pointers −Step 1 − Declare and read the number of elements.Step 2 − Declare and read the array size at runtime.Step 3 − ... Read More

8K+ Views
Unformatted input and output functions read a single input sent by the user and permit the display of the value as the output at the console. Unformatted input functions The unformatted input functions in the C programming language are used only for character data type or character string/array and cannot be used for any other datatype. These functions are used to read a single input from the user and this allows the user to display the value at the console. The getchar() Function This getchar() function reads only the first single character from the given keyboard that multiplies characters is typed ... Read More

4K+ Views
A pointer is a variable that stores the address of another variable. We can hold the null values by using pointer. It can be accessed by using pass by reference. Also, there is no need of initialization, while declaring the variable. Instead of holding a value directly, it holds the address where the value is stored in memory. The two main operators used with pointers are the dereferencing operator and the address operator. These operators are used to declare pointer variables and access the values stored at those address. Pointer variable uses the dereferencing operator to access the value it ... Read More

3K+ Views
An array is a group of related data items which share’s a common name. A particular value in an array is identified with the help of its "index number".Declaring arrayThe syntax for declaring an array is as follows −datatype array_name [size];For example, float marks [50]It declares ‘marks’ to be an array containing 50 float elements.int number[10]It declares the ‘number’ as an array to contain a maximum of 10 integer constants.Each element is identified by using an "array index".Accessing array elements is easy by using the array index.The logic we use for merge sort is as follows −void MergeSort(int *array, int ... Read More

4K+ Views
ProblemWrite a C program to delete an element from an array at runtime by the user and the result to be displayed on the screen after deletion. If the deleted element is not in an array, then we need to display Invalid Input.SolutionAn array is used to hold the group of common elements under one name.The array operations are as follows −InsertDeleteSearchAlgorithmRefer an algorithm to delete the elements into an array with the help of pointers.Step 1 − Declare and read the number of elements.Step 2 − Declare and read the array size at runtime.Step 3 − Input the array ... Read More

6K+ Views
ProblemWrite a C program to insert the elements into an array at runtime by the user and the result to be displayed on the screen after insertion. If the inserted element is greater than the size of an array, then, we need to display Invalid Input.SolutionAn array is used to hold the group of common elements under one name.The array operations are as follows −InsertDeleteSearchAlgorithmRefer an algorithm to insert the elements into an array with the help of pointers.Step 1: Declare and read the number of elements.Step 2: Declare and read the array size at runtime.Step 3: Input the array ... Read More

120K+ Views
Problem Sort the given array in descending or ascending order based on the code that has been written. Solution An array is a group of related data items which share’s a common name. A particular value in an array is identified with the help of its "index number". Declaring array The syntax for declaring an array is as follows − datatype array_name [size]; For example, float marks [50] It declares ‘marks’ to be an array containing 50 float elements. int number[10] It declares the ‘number’ as an array to contain a maximum of 10 integer constants. Each element is identified ... Read More

17K+ Views
ProblemSort the given array in descending or ascending order based on the code that has been written.SolutionAn array is a group of related data items which share’s a common name. A particular value in an array is identified with the help of its "index number".Declaring arrayThe syntax for declaring an array is as follows −datatype array_name [size];For example, float marks [50]It declares ‘marks’ to be an array containing 50 float elements.int number[10]It declares the ‘number’ as an array to contain a maximum of 10 integer constants.Each element is identified by using an "array index".Accessing array elements is easy by using ... Read More

20K+ Views
Pointers A pointer is a variable that stores the address of another variable. Instead of holding a value directly, it holds the address where the value is stored in memory. The two main operators used with pointers are the dereferencing operator and the address operator. These operators are used to declare pointer variables and access the values stored at those addresses. The pointer variable uses the dereferencing operator to access the value it points to. We use the address operator to obtain the memory address of a variable and store it in the pointer variable. We use pointers to access ... Read More