Bhanu Priya has Published 1448 Articles

Explain the constant type qualifier in C language

Bhanu Priya

Bhanu Priya

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

236 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

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

353 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

905 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

Write C program using isupper() function

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 07:59:15

213 Views

ProblemHow to identify a total number of upper-case alphabets in a string using C Programming?SolutionThe logic we used to count number of upper-case letters in a sentence is as follows −for(a=string[0];a!='\0';i++){    a=string[i];    if (isupper(a)){       counter=counter+1;       //counter++;    } }Example 1 Live Demo#include #include ... Read More

Explain malloc function in C programming

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 07:56:53

694 Views

ProblemWrite a C program to display and add the elements using dynamic memory allocation functions.SolutionIn C, the library function malloc allocates a block of memory in bytes at runtime. It returns a void pointer, which points to the base address of allocated memory and it leaves the memory uninitialized.Syntaxvoid *malloc ... Read More

Write a C program to check the atexit() function

Bhanu Priya

Bhanu Priya

Updated on 06-Mar-2021 07:52:09

556 Views

The atexit() is a function that allows the user to register a function that has to be called based on program termination.It is a predefined function that is included in stdlib header files.Example 1 Live Demo#include #include void welcome(void){    printf("Welcome to New, "); } void world(void){    printf("World"); } int ... Read More

Advertisements