Bhanu Priya has Published 1581 Articles

How to print the elements in a reverse order from an array in C?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 06:16:34

8K+ Views

Try to print the elements in reverse order by following an algorithm given below −Step1 − Declare an array of size 5Step 2 − Enter the 5 elements in memory using for loopStep 3 − Display elements in reverse orderBy decrementing for loopThe only logic is to reverse the elements ... Read More

What are the Pre-processor Commands in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 06:14:36

3K+ Views

The preprocessor is a program that sends the source code before it passes through the compiler. It operates under preprocessor directives which begin with the symbol #.TypesThe three types of preprocessor commands are as follows −Macro substitution directives.File inclusion directives.Compiler control directives.Macro substitution directivesIt replaces every occurrence of an identifier ... Read More

Explain volatile and restrict type qualifiers in C with an example

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 06:13:02

770 Views

Type qualifiers add special attributes to existing data types in C programming language.There are three type qualifiers in C language and volatile and restrict type qualifiers are explained below −VolatileA volatile type qualifier is used to tell the compiler that a variable is shared. That is, a variable may be ... Read More

Explain the constant type qualifier in C language

Bhanu Priya

Bhanu Priya

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

156 Views

Type qualifiers add special attributes to existing datatypes in C programming language.There are three type qualifiers in C language and constant type qualifier is explained below −ConstThere are three types of constants, which are as follows −Literal constantsDefined constantsMemory constantsLiteral constants − These are the unnamed constants that are used ... Read More

Decimal to Binary conversion using C Programming

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 06:05:08

3K+ Views

ProblemHow to convert a decimal number to a binary number by using the function in the C programming language?SolutionIn this program, we are calling a function to binary in main(). The called function to binary will perform actual conversion.The logic we are using is called function to convert decimal number ... Read More

What do you mean by function return in C language?

Bhanu Priya

Bhanu Priya

Updated on 08-Mar-2021 05:56:30

4K+ Views

A function is a self-contained block that carries out a specific task.The advantages of function in C language are as follows −ReusabilityThe length program can be reduced.It is easy to locate and isolate a wrong function.It facilitates top-down modular programming.ExampleFollowing is the C program for functions −#include /*Function prototypes*/ myfunc(); ... Read More

How to calculate sum of random numbers in between 0 to 100 using files in C Programming?

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 16:35:57

2K+ Views

In this program, we are adding random numbers that are generated in between 0 and 100.After every runtime, the result of sum of random numbers is different, i.e., we get a different result for every execution.The logic we use to calculate the sum of random numbers in between 0 to ... Read More

Write a C program using time.h library function

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 16:33:29

232 Views

ProblemHow to display the current date and time in ISO standard format using C Programming language?SolutionThe current date and time of the input will be taken and we are trying to print the system time and date in ISO format.For example, Monday, Dec 15, 2020 10.50p.The built-in functions that we ... Read More

Calculate interest amount by using formula in C language

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 16:17:24

739 Views

ProblemWrite a C program to calculate the deposited amount incremented after some years with interestSolutionThe formula for calculating interest is −M=((r/100) * t); A=P*exp(M);Where r= rate of interest            t=no. of years            P=amount to be deposited            ... Read More

Write a C program to demonstrate post increment and pre increment operators

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 08:02:49

3K+ Views

Increment operator (++)It is used to increment the value of a variable by 1. There are two types of increment operators, pre-increment and post-increment.The increment operator is placed before the operand in pre-increment and the value is first incremented and then the operation is performed on it.For example, z = ... Read More

Advertisements