Bhanu Priya has Published 1581 Articles

Explain the concept of Sorting in C language

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:51:40

4K+ Views

ProblemWhy sorting makes searching easier in C language? How can you judge the sorting efficiency in C?SolutionSorting is the process of arranging elements either in ascending (or) descending order.The term sorting came into existence when humans realized the importance of searching quickly.There are different things in life that we need ... Read More

How to print the content into the files using C language?

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:51:00

175 Views

We can write a program in C for printing some content in to the file and print the following −Number of characters entered into the file.Reverse the characters entered into the file.First, try to store number of characters into the file by opening the file in write mode.For entering data ... Read More

Explain the Random accessing files in C language

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:20:51

9K+ Views

Random accessing of files in C language can be done with the help of the following functions −ftell ( )rewind ( )fseek ( )ftell ( )It returns the current position of the file ptr.The syntax is as follows −int n = ftell (file pointer)For example, FILE *fp; int n; _____ ... Read More

What are the error handling techniques in C language?

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:19:58

318 Views

Some of the errors that occurs in the files are listed below −Trying to read beyond end of file.Device over flow.Trying to open an invalid file.An invalid operation is performed by opening a file in a different mode.Functions for error handlingThe functions for error handling are as follows −ferror ( ... Read More

C program to display relation between pointer to pointer

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:10:58

245 Views

In C programming language, pointer to pointer or double pointer is a variable that holds the address of another pointer.DeclarationGiven below is the declaration for pointer to pointer −datatype ** pointer_name;For example, int **p;Here, p is a pointer to pointer.Initialization‘&’ is used for initialization.For example, int a = 10; int ... Read More

C Program for copying the contents of one file into another file

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:09:19

18K+ Views

File is a collection of records (or) is a place on hard disk, where data is stored permanently. By using C commands, we can access the files in different ways.Operations on filesThe operations that can be carried out on files in C language are as follows −Naming the file.Opening the ... Read More

What are the high level I/O functions in C language?

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 07:03:50

4K+ Views

I/O refers to the input - output functions in C language.High level I/OThese are easily understood by human beingsThe advantage is portability.Low level I/OThese are easily understood by computer.The advantage is that execution time is less.The disadvantage is that Non portability.High level I/O FunctionsThe high level input - output (I/O) ... Read More

What are the different operations on files in C language?

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 06:56:26

6K+ Views

The operations that can be carried out on files in C language are as follows −Naming the file.Opening the file.Reading from the file.Writing into the file.Closing the file.SyntaxThe syntax for opening and naming file is as follows −FILE *File pointer;For example, FILE * fptr;File pointer = fopen ("File name”, "mode”);For ... Read More

Write a C program to work on statements using functions and loops

Bhanu Priya

Bhanu Priya

Updated on 10-Mar-2021 09:36:53

75 Views

ProblemHow to print the long lines into two or more short lines based on specified length in the program using C Language?SolutionLet’s write a code to read a long line and print into two or more short lines according to the mentioned size in the program.The built in functions that ... Read More

What are the text files and binary files in C language?

Bhanu Priya

Bhanu Priya

Updated on 09-Mar-2021 10:05:14

11K+ Views

Files is collection of records (or) it is a place on hard disk, where data is stored permanently.Types of FilesThere are two types of files in C language which are as follows −Text fileBinary FileText FileIt contains alphabets and numbers which are easily understood by human beings.An error in a ... Read More

Advertisements