C program to Delete an Element from an Array

An array is a collection of similar data elements stored in a contiguous memory location. Example: arr[6] = {12,65,32,75,48,11} Value: 12 65 32 75 48 11 ↑ ↑ ↑ ↑ ↑ ↑ Index: 0 1 2 3 4 5 The Element we are deleting here is “75”. Original Array: 12 65 32 75 48 11 … Read more

advertisement

C Program to Cyclically Permute the Elements of an Array

This is a C Program to cyclically permutes the elements of an array. Problem Description This program first accepts an array. Assume there are 4 elements in an array. It takes 2 element as a first element in an array and so on till the last element of the given array. Now here first element … Read more

advertisement

C Program to Swap Elements in an Array using Pointers

This is a C Program to accept an array & swap elements using pointers. Problem Description The program will implement an array and will swap the elements of the array. Swapping is done using pointers. Problem Solution 1. Declare an array and define all its elements. 2. Create a function with two parameters i.e. two … Read more

advertisement

C Program to Find Sum of two One-Dimensional Arrays using Malloc

This is a C Program to Compute the Sum of two One-Dimensional Arrays using malloc(). Problem Description We have to write a program in C such that the program will allocate 2 one-dimensional arrays using malloc() call and then will do the addition and stores the result into 3rd array. The 3rd array is also … Read more

advertisement

C Program to Find Sum of Array Elements using Pointer as Arguments

This C Program calculates the sum of all elements of an array using pointers as arguments. Problem Description The program calls a function to add all the element of an array and passes the array argument as a pointer. Problem Solution 1. Create a static array of some fixed size, along with element declaration. 2. … Read more

advertisement

C Program to Find Sum of Array Elements using Pointer

This is a C program to calculate sum of array elements using pointer. Problem Description We have to write a program in C such that it calculates the sum of elements of an array using pointers. The program should dynamically allocate a piece of memory for that array and use a pointer to point to … Read more

advertisement

C program to Insert an Element in the Sorted Array

This is a C Program to insert an element in a specified position in a given array. Problem Description This program implements a one dimentional array, sorts it and then takes a user input and inserts the desired element in the specified position of a one dimentional array and print all the elements of the … Read more

advertisement

C program to Find Largest and Second Largest Elements in Array

This is a C Program to calculate the largest two numbers in a given Array. Problem Description We have to write a program in C such that the program will read the elements of a one-dimensional array, then compares the elements and finds which are the largest two elements in a given array. Expected Input … Read more

advertisement

C Program to Find Sum of All Elements in an Array

Fundamentally, an array is a data structure containing a collection of values or variables. The simplest type of array is a linear array or one-dimensional array. An array can be defined in C with the following syntax: int Arr[5] = {10, 20, 30, 40, 50}; /* here 10,20,30,40,50 are the elements at indices 0,1,2,3,4 respectively … Read more

advertisement

C Program to Find Second Largest and Smallest Elements of an Array

This C Program finds second largest & smallest elements in an Array. Problem Description The program will implement a one dimentional array and sort the array in descending order. Then it finds the second largest and smallest element in an array and also find the average of these two array elements. Later it checks if … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.