Bhanu Priya

Bhanu Priya

1,060 Articles Published

Articles by Bhanu Priya

Page 16 of 106

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

Bhanu Priya
Bhanu Priya
Updated on 12-Dec-2024 16K+ Views

A file is a collection of data stored in secondary memory, used for storing information that can be processed. Files allow data to be saved and retrieved later. They can store both programs and data, making file input and output operations crucial for reading from and writing to files. There are two types of files in C language which are as follows − Text file Binary File Text File Text files contain alphabets and numbers that are easily understood by humans. Errors in text files can be easily identified and ...

Read More

What are the special symbols in C language?

Bhanu Priya
Bhanu Priya
Updated on 12-Dec-2024 65K+ Views

In C programming language, generally, the special symbols have some special meaning. This language provides low-level access to the memory and it is identified for its performance and efficiency. The C language includes a character set of English alphabets(a-z, A-Z), digits(0-9), and specific meaning with special characters. Some special characters are operators, while combinations like "" are escape sequence. In C symbols are used to perform special operations. Some of the special symbols that are used in C programming are as follows − [] () {}, ; * = # Common Characters in C Programming Let’s understand their definitions, which ...

Read More

C program to print area of triangle, square, circle, rectangle and polygon using switch case.

Bhanu Priya
Bhanu Priya
Updated on 10-Dec-2024 51K+ Views

Problem Write a program to calculate the area of triangle, square, circle, rectangle and polygon by using the switch case. Solution Based on case number, the area of triangle, square, circle, rectangle and polygon is calculated. The logic used to find area of triangle is as follows − Enter sides of a triangle a, b, c s=(float)(a+b+c)/2; area=(float)(sqrt(s*(s-a)*(s-b)*(s-c))); The logic used to find area of square is as follows − Enter the side of square at runtime. area=(float)side*side; The logic used to find ...

Read More

How to write a C program to find the roots of a quadratic equation?

Bhanu Priya
Bhanu Priya
Updated on 10-Dec-2024 156K+ Views

Problem Applying the software development method to solve any problem in C Language. Solution Find roots of a quadratic equation, ax2+bx+c. There will be 2 roots for given quadratic equation. Analysis Input − a, b, c values Output − r1, r2 values Procedure $r_{1}=\frac{-b+\sqrt{b^2-4ac}}{2a}$ $r_{2}=\frac{-b-\sqrt{b^2-4ac}}{2a}$ Design (Algorithm) Start Read a, b, c values Compute d = b2 4ac if d > 0 then ...

Read More

How to swap two arrays without using temporary variable in C language?

Bhanu Priya
Bhanu Priya
Updated on 09-Dec-2024 6K+ Views

Swap two arrays without using a temporary variable. We will use arithmetic and bitwise Operators instead of a third variable. The logic to read the first array is as follows − printf("enter first array ele:"); for(i = 0; i < size; i++){ scanf("%d", &first[i]); } The logic to read the second array is as follows − printf("enter first array ele:"); for(i = 0; i < size; i++){ scanf("%d", &first[i]); } The logic to swap the two arrays without using a third variable is as follows − for(i = 0; i < size; i++){ ...

Read More

How to convert binary to Hex by using C language?

Bhanu Priya
Bhanu Priya
Updated on 09-Dec-2024 11K+ Views

Binary numbers are represented in 1’s and 0’s. It can also be referred to as a rational number with a finite representation in the system. This is a quotient of an integer by a power of two. Hexadecimal number system with 16 digits is {0, 1, 2, 3…..9, A(10), B(11), ……F(15)}. In base 16 transfer encoding, each byte of plain text is divided into two 4-bit values, which are represented by two hexadecimal digits. Converting Binary to Hex using C To convert from binary to hexadecimal representation, the bit string is grouped into 4-bit blocks, called nibbles, starting from the ...

Read More

Explain the sorting techniques in C language

Bhanu Priya
Bhanu Priya
Updated on 09-Dec-2024 45K+ Views

In this article, we are going to learn about the different sorting techniques and their implementations in C language. Sorting in C programming requires rearranging elements in the array into a determined order, i.e., in ascending or descending order. This will use the comparison operator to specify the new order of a list or array. This is widely used in different applications that include searching algorithms, data structure optimization, and database management. The following are the sorting techniques that we can implement with C language and other programming also: ...

Read More

Explain putc() and getc() functions of files in C language

Bhanu Priya
Bhanu Priya
Updated on 06-Dec-2024 13K+ Views

A file is a collection of data stored in secondary memory. Files are used to store information that programs can determine. A file represents a sequence of bytes, whether it is a text file or a binary file. It is a collection of records or a location on the hard disk where data is stored permanently. Operations on Files The operations on files in the C programming language are as follows − Naming the file Opening the file Reading from the file Writing into ...

Read More

C program to find maximum occurrence of character in a string

Bhanu Priya
Bhanu Priya
Updated on 06-Dec-2024 4K+ Views

An array of characters is called a string. Declaration Following is the declaration declaring an array is as follows − char stringname [size]; For example: char string[50]; string of length 50 characters Initialization Using single character constant − char string[10] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’ ,‘\0’} Using string constants − char string[10] = "Hello":; Accessing − There is a control string "%s" used for accessing the string till it encounters ‘\0’. Finding maximum occurrence The logic to find the maximum occurrence of character is − ...

Read More

What is shared memory architecture in parallel databases?

Bhanu Priya
Bhanu Priya
Updated on 04-Jul-2024 5K+ Views

In parallel database system data processing performance is improved by using multiple resources in parallel. In this CPU, disks are used parallel to enhance the processing performance. Operations like data loading and query processing are performed parallel. Centralized and client server database systems are not powerful enough to handle applications that need fast processing. Parallel database systems have great advantages for online transaction processing and decision support applications. Parallel processing divides a large task into multiple tasks and each task is performed concurrently on several nodes. This gives a larger task to complete more quickly. Architectural Models There are several ...

Read More
Showing 151–160 of 1,060 articles
« Prev 1 14 15 16 17 18 106 Next »
Advertisements