quescol
C program to perform right rotation in array by 2 positions
Performing right rotation in array means, our last element will become first element and shift each array elements towards right by one. Here we are going to perform right rotation by 2 times means we will shift each array element toward right two times. Our problem statement Suppose we have an array that has elements a={1,2,3,4,5}. … Read more
C Program to print all odd numbers in array
In this tutorial, we will learn a writing program in c to print all odd numbers present in an array. As we know that odd number is a number that is not divisible by 2. Our logic will be like, iterate each array element and check if it is divisible by 2 or not. If … Read more
C Program to print all even numbers in array
In this tutorial, we will learn a writing program in c to print all even numbers in an array. As we know that even number is divisible by 2. Here we will iterate each array element and check it is divisible by 2 or not. If it is divisible by 2 then we will print … Read more
C Program to find sum of array elements
To write a program in C to find sum of array elements, We will just iterate the array elements one by one using for loop or while loop and add each element. This program is very easy and logic is also very simple. Program in C to find the sum of array elements Output
C Program to delete element from array at given index
In this tutorial, we are going to learn to write C Program to delete element from an array at the given index. To delete the element from the given index, we will iterate the array and to the given index. Now we will just shift each element towards the left one by one and decrease … Read more
C Program to delete given element from array
In this tutorial, we are going to learn to write C Program to delete a given element from an array. To delete the given element we will compare the given element with the array elements. If we find a match then will delete the element from the array otherwise will check for the next array … Read more
C Program to delete element at end of Array
To delete an element from the end in an array, we will just reduce the size of an array by one. After reducing the size we will print the array and will find that the last element is not printing. It means that the element is not in the array now. Introduction to Arrays in … Read more
C program to insert element at a given location in Array
In this tutorial, we will learn to write C program to insert an element at the given location in an array. To insert an element at a given location first we have to go to that location and then shift each element towards the right. Or we can also do something like shifting the elements … Read more