Bhanu Priya has Published 1612 Articles

How to access an array element in C language?

Bhanu Priya

Bhanu Priya

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

5K+ 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

How to write a simple calculator program using C language?

Bhanu Priya

Bhanu Priya

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

17K+ Views

Begin by writing the C code to create a simple calculator. Then, follow the algorithm given below to write a C program.AlgorithmStep 1: Declare variables Step 2: Enter any operator at runtime Step 3: Enter any two integer values at runtime Step 4: Apply switch case to select the operator: ... 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

201 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

930 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

9K+ 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

What are string literals in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 07:21:38

4K+ Views

A string literal is a sequence of chars, terminated by zero. For example, Char * str = "hi, hello"; /* string literal */String literals are used to initialize arrays.char a1[] = "xyz"; /* a1 is char[4] holding {'x', 'y', 'z', '\0'} */ char a2[4] = "xyz"; /* same as a1 ... Read More

Explain the custom header files in C language

Bhanu Priya

Bhanu Priya

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

462 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

8K+ 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 different format specifiers used in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 07:07:43

535 Views

Format specifiers are used for input-output (I/O) operations. With the help of a format specifier, the compiler can understand what type of data is in I/O operation.There are some elements that affect the format specifier. They are as follows −A minus symbol (-): Left alignment.The number after % specifies the ... Read More

What are Backslash character constants in C language?

Bhanu Priya

Bhanu Priya

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

4K+ 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