Bhanu Priya has Published 1449 Articles

How to find a leap year using C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 10:09:07

365 Views

Leap year is a year that consists of 366 days. For every four years, we will experience a leap year.The logic we will implement to find whether the given year by the user through the console is a leap or not −if (( year%400 == 0)|| (( year%4 == 0 ... Read More

How to display the complete text one word per line in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 10:06:44

1K+ Views

First, open the file in write mode. Later on, enter the text until it reaches the End Of File (EOF) i.e. press ctrlZ to close the file.Again, open in reading mode. Then, read words from the file and print each word in a separate line and close the file.The logic ... Read More

Explain the accessing of structure variable in C language

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 10:05:00

1K+ Views

The structure is a user-defined data type, which is used to store a collection of different data types of data.The structure is similar to an array. The only difference is that an array is used to store the same data types whereas, the structure is used to store different data ... Read More

How to access an array element in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 10:02:11

7K+ Views

An array is a group of related data items that share a common name. A particular value in an array is identified by using its "index number" or "subscript".The advantage of an array is as follows −The ability to use a single name to represent a collection of items and ... Read More

Write a C program to find out profit or loss in buying an article

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 09:55:39

313 Views

The formula for finding profit is as follows if the selling price is greater than cost price −profit=sellingPrice-CosePrice;The formula for finding loss is as follows if cost price is greater than selling price −loss=CostPrice-SellingPriceNow, apply this logic in the program and try to find whether the person gets a profit ... Read More

How to write the temperature conversion table by using function?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 09:53:40

1K+ Views

Temperature conversion is nothing but converting Fahrenheit temperature to Celsius or Celsius to Fahrenheit.In this programming, we are going to explain, how to convert the Fahrenheit temperature to Celsius temperature and how to represent the same in the form of the table by using a function.ExampleFollowing is the C program ... Read More

What do you mean by buffer in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 09:50:04

10K+ Views

A temporary storage area is called buffer. All input output (I/O) devices contain I/O buffer.When we try to pass more than the required number of values as input then, the remaining values will automatically hold in the input buffer. This buffer data automatically go to the next input functionality, if ... Read More

Explain the custom header files in C language

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 07:20:41

591 Views

ProblemCan the user create his/her own custom header files in the C language? If yes, how can we access the user-defined header files?SolutionYes, the user can create his/her own custom header files in C.It helps you to manage the user-defined methods, global variables, and structures in a separate file, which ... Read More

Explain the variable declaration, initialization and assignment in C language

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 07:16:24

11K+ Views

The main purpose of variables is to store data in memory. Unlike constants, it will not change during the program execution. However, its value may be changed during execution.The variable declaration indicates that the operating system is going to reserve a piece of memory with that variable name.Variable declarationThe syntax ... Read More

What are Backslash character constants in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 07:06:32

5K+ Views

A backslash ( \ ) that allows a visual representation of some nongraphic characters introduces an escape.One of the common escape constants is the newline character ( ).Backslash CharactersThe backslash characters are as follows −CharacterMeaning‘\a’alert‘\b’backspace‘\f’form feed‘’newline‘\t’horizontal tab‘\r’carriage return‘\v’vertical tab‘\’backslash‘\’ ’single quote‘\" ’double quote‘\?’Question markExample programFollowing is the C program ... Read More

Advertisements