Bhanu Priya has Published 1581 Articles

C program to store the car information using dynamic linked list.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:57:51

3K+ Views

Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. It is collection of nodes.Node has two parts which are as follows −DataLinkTypes of Linked ListsThe types of linked lists in C programming language are as follows −Single / Singly linked listsDouble / Doubly linked listsCircular single linked ... Read More

C program to perform intersection operation on two arrays

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:55:31

6K+ Views

Intersection operationIf array 1 = { 1,2,3,4,6}  Array 2 = {1,2,5,6,7}Then, intersection of array1 and array 2 isArray1 ^ array 2 = {1,2,3,4,6} ^ {1,2,5,6,7}         = {1,2,6}Set of common elements is called an intersection.The logic for intersection is as follows −k=0; for(i=0;i

C program to find the area of circle and cylinder using structures.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:54:54

2K+ Views

In C programming language, we can find the area of circle, area and volume of cylinder with the help of structures.The logic used to find area of circle is as follows −s.areacircle = (float)pi*s.radius*s.radius;The logic used to find area of cylinder is as follows −s.areacylinder = (float)2*pi*s.radius*s.line + 2 * ... Read More

What is an anagram in C language?

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:52:46

3K+ Views

Anagram strings are nothing but, all the characters that occur for the same number of times in another string, which we call as anagrams.A user enters two strings. We need to count how many times each letter ('a' to 'z') appears in them and then, compare their corresponding counts. The ... Read More

C program to perform union operation on two arrays

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:52:41

12K+ Views

A union is a special data type available in C programming language that allows to store different data types in the same memory location. Unions provide an efficient way of using the same memory location for multiple-purpose.Union operationIf array 1 = { 1, 2, 3, 4, 6}    Array 2 ... Read More

C Program find nCr and nPr.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:50:25

14K+ Views

In C programming language, nCr is referred as the combination. nCr is the selection of r objects from a set of n objects, where the order of objects does not matter.nPr is referred as the permutation. nPr is arrangement of 'r' objects from a set of 'n' objects, which should ... Read More

C program to sort names in alphabetical order

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:48:29

57K+ Views

User has to enter number of names, and those names are required to be sorted in alphabetical order with the help of strcpy() function.An array of characters (or) collection of characters is called a string.DeclarationFollowing is the declaration for an array −char stringname [size];For example, char string[50]; string of length ... Read More

What is a simple assertion in C language?

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:47:41

209 Views

An assertion is a statement which is used to declare positively that a fact must be true when that line of code is reached.Assertions are useful for obtaining the expected conditions which are met.Simple AssertionSimple assertion can be implemented by using assert (expression) method, which is present in assert.h header ... Read More

C Program to find sum of perfect square elements in an array using pointers.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:45:42

1K+ Views

ProblemWrite a program to find the sum of perfect square elements in an array by using pointers.Given a number of elements in array as input and the sum of all the perfect square of those elements present in the array is output.SolutionFor example, Input= 1, 2, 3, 4, 5, 9, ... Read More

C program to swap two strings

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:45:27

9K+ Views

For swapping two strings from one location to another location, we use strcpy() function.An array of characters (or) collection of characters is called a string.DeclarationFollowing is the declaration for an array −char stringname [size];For example, char string[50]; string of length 50 characters.InitializationUsing single character constantchar string[10] = { ‘H’, ‘e’, ... Read More

Advertisements