# C TUTORIAL
# C PROGRAMS
Array Programs
➤ Find Length of Array
➤ How to Print an Array
➤ Sum of Array Elements
➤ Reverse an Array in C
➤ Copy an Array in C
➤ Merge Two Arrays in C
➤ Merge Two Sorted Arrays
➤ Count Repeated Elements
➤ Find Duplicate Elements
➤ Linear Search in C
➤ Binary Search in C
➤ Insert Element in Array
➤ Delete Element in Array
➤ Display odd-even in Array
➤ Sum & Count of Odd-Even
➤ Count +ve, -ve, & 0
➤ Sum of +ve, -ve Numbers
➤ Avg & Numbers > Avg
➤ Smallest & Largest Element
➤ 1st 2nd Max-Min
➤ Sort Array in C
➤ Search element in Array
➤ Search index of Nth times occurred element
➤ Matrix Programs
# C PROGRAMS
Array Programs
➤ Find Length of Array
➤ How to Print an Array
➤ Sum of Array Elements
➤ Reverse an Array in C
➤ Copy an Array in C
➤ Merge Two Arrays in C
➤ Merge Two Sorted Arrays
➤ Count Repeated Elements
➤ Find Duplicate Elements
➤ Linear Search in C
➤ Binary Search in C
➤ Insert Element in Array
➤ Delete Element in Array
➤ Display odd-even in Array
➤ Sum & Count of Odd-Even
➤ Count +ve, -ve, & 0
➤ Sum of +ve, -ve Numbers
➤ Avg & Numbers > Avg
➤ Smallest & Largest Element
➤ 1st 2nd Max-Min
➤ Sort Array in C
➤ Search element in Array
➤ Search index of Nth times occurred element
➤ Matrix Programs
There are many Sorting algorithms, which sort a list of an array elements.
#include<stdio.h>
int main()
{
int n, i, j;
printf("Enter array range(no of array element): ");
scanf("%d",&n);
int arr[n];
printf("Enter the array element: ");
// take input(Array elements)
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
// now, sort array elements
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(arr[i]>arr[j])
{
int temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
}
}
}
// display sorted array
printf("Sorted array elements are:\n");
for(i=0;i<n;i++)
{
printf("%d\n",arr[i]);
}
return 0;
}
Output:-
Enter array range(no of array element): 5
Enter the array element: 90
23
5
60
40
Sorted array elements are:
5
23
40
60
90
If you enjoyed this post, share it with your friends. Do you want to share more information about the topic discussed above or do you find anything incorrect? Let us know in the comments. Thank you!
Similar C program using Arrays
- C program to find the sum of elements in an array
- Display even and odd numbers in an array
- Sum and count of even and odd numbers in an array
- Count the positive, negative, and zeros in an array
- Sum of positive and negative numbers in an array
- Average and numbers greater than average in array
- Smallest & largest array element with their position
- First max and min, Second max and min number in array
- C program to sort a list of an array element & display
- C program to search an Array element and display index
- Search position of Nth times occurred element in array
- C program to insert an element in a given array
- C program to delete an element in a given array
Examples on multidimensional Array in C
I have wanted to post something like this on one of my blogs and this has given me an idea. Thank you.
You are not the general blog writer, man. You certainly have something important to contribute to the World Wide Web. Such a special blog. I will return for more.