Bhanu Priya has Published 1449 Articles

C Program to find minimum occurrence of character in a string

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 14:12:33

2K+ Views

An array of characters is called a string.DeclarationFollowing is the declaration for declaring an array is as follows −char stringname [size];For example − char string[50]; string of length 50 charactersInitializationUsing single character constant −char string[10] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’ ,‘\0’}Using string constants −char string[10] = "Hello":;Accessing − ... Read More

Write a C Program to count the frequency of each character

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 14:06:56

795 Views

Follow the algorithm to write a C program which enables to count the frequency of each character.AlgorithmStep 1: Define MAX size. Step 2: Declare char and integer variables. Step 3: Read the string from console. Step 4: Find length of the string. Step 5: Initialize frequency of each character to ... Read More

Explain the Character operations in C language

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 14:05:54

614 Views

Character can be (A-Z(or) a- z), digit (0-9), a white space, or a special symbol in C programming language.DeclarationFollowing is the declaration for character operations in C programming −char a= ‘A’; using a character constant.Character input / output functionsThe character input/output functions are explained below −Example − char a;scanf("%c", &a); ... Read More

Explain the pointers to unions in C language

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 14:03:36

4K+ Views

A union is a memory location that is shared by several variables of different data types.SyntaxThe syntax for the pointers to unions in C programming is as follows −union uniontag{    datatype member 1;    datatype member 2;    ----    ----    datatype member n; };ExampleThe following example shows ... Read More

Explain linear data structure queue in C language

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 13:59:45

743 Views

Data structure is collection of data organized in a structured way. It is divided into two types as explained below −Linear data structure − Data is organized in a linear fashion. For example, arrays, structures, stacks, queues, linked lists.Nonlinear data structure − Data is organized in a hierarchical way. For ... Read More

What is a structure at local scope in C language?

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 13:58:27

937 Views

Structure is a collection of different datatype variables, grouped together under a single name.General form of structure declarationThe structure declaration is as follows −struct tagname{    datatype member1;    datatype member2;    datatype member n; };Here, struct is the keyword.tagname specifies name of structure.member1, member2 specifies the data items that ... Read More

How to pass the address of structure as an argument to function in C?

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 13:56:39

8K+ Views

There are three ways by which the values of structure can be transferred from one function to another. They are as follows −Passing individual members as arguments to function.Passing entire structure as an argument to function.Passing the address of structure as an argument to function.Now, let us understand how to ... Read More

Explain C Error handling functions

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 13:53:46

861 Views

File is collection of records or is a place on hard disk, where data is stored permanently.Operations on filesThe operations on files in C programming language are as follows −Naming the fileOpening the fileReading from the fileWriting into the fileClosing the fileSyntaxThe syntax for opening a file is as follows ... Read More

How to pass an entire structure as an argument to function in C?

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 13:47:03

4K+ Views

There are three ways by which the values of structure can be transferred from one function to another. They are as follows −Passing individual members as arguments to function.Passing entire structure as an argument to function.Passing the address of structure as an argument to function.Now let’s see how to Pass ... Read More

Explain the dynamic memory allocation of pointer to structure in C language

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 13:44:57

5K+ Views

Pointer to structure holds the add of the entire structure.It is used to create complex data structures such as linked lists, trees, graphs and so on.The members of the structure can be accessed using a special operator called as an arrow operator ( -> ).DeclarationFollowing is the declaration for pointers ... Read More

Advertisements