Bhanu Priya has Published 1581 Articles

Explain recursive function in C language with program

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:46:38

459 Views

Recursive Functions is the process of defining something in terms of itself. It is a function that calls itself again in the body of the function.A function fact ( ), that computes the factorial of an integer ‘N’ ,which is the product of all whole numbers from 1 to N.When ... Read More

How communication among functions is established in C language?

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:45:24

504 Views

Functions communicate among themselves with the help of arguments and return value.Farm of ‘C’ function is as follows −return-datatype function name (argument list){    local variable declarations;    executable statements(s);    return (expression); }For example, void mul (int x, int y){    int p;    p=x*y;    printf("product = %d”, ... Read More

Explain top-down design and structure chart of function in C language

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:43:10

1K+ Views

A function is a self-contained block that carries out a specific well defined task.Advantages of functions in C language include −Reusability.The length of the program can be reduced.It is easy to locate and find any faulty function.It facilitates top-down modular programming.Top down design and structure chartsIt is a problem solving ... Read More

How floats are stored in C compiler?

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:41:56

665 Views

In C programming language, float is a short term for floating point.Floating point numbers are generally represented in the form of Institute of Electrical and Electronics Engineers (IEEE) format.The IEEE format uses a sign bit, a mantissa and an exponent for representing the power of 2.The sign bit denotes the ... Read More

How to print the range of numbers using C language?

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:41:01

1K+ Views

ProblemFor given number try to find the range in which that number exists.SolutionHere, we are learning how to find the ranges of a number.The logic that we apply to find range is −lower= (n/10) * 10; /*the arithmetic operators work from left to right*/ upper = lower+10;ExplanationLet number n=45Lower=(42/10)*10 // ... Read More

Finding sum of first and last digit using divide and modulo operator in C language

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:40:17

395 Views

ProblemWhat is the C program to obtain the sum of the first and last digit of the number, if a four-digit number is input through the keyboard?SolutionIn this program, we are taking a four-digit number at run time and trying to find the sum of first and last digit of ... Read More

What are the loop control statements in C language? Explain with flow chart and program

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:35:21

6K+ Views

Loop control statements are used to repeat set of statements. They are as follows −for loopwhile loopdo-while loopfor loopThe syntax is as follows −for (initialization ; condition ; increment / decrement){    body of the loop }Flow chartThe flow chart for loop is as follows −Initialization is usually an assignment ... Read More

Explain feof() function in C language with a program

Bhanu Priya

Bhanu Priya

Updated on 13-Mar-2021 11:18:45

350 Views

ProblemHow the C compiler detect that the file was reached the end for while reading? Explain with a program.Solutionfeof() is a file handling function in C language, which is used to find end of a file.The logic we used for finding end of file is as follows −fp = fopen ... Read More

How to pass the individual members as arguments to function using structure elements?

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 14:02:48

2K+ Views

There are three ways by which the values of structure can be transferred from one function to another. They are as follows −Passing individual members as arguments to function.Passing entire structure as an argument to function.Passing the address of structure as an argument to function.Now let’s see how to pass ... Read More

What are different operators and expressions used in C language?

Bhanu Priya

Bhanu Priya

Updated on 11-Mar-2021 11:14:07

11K+ Views

  Operator performs an operation on data. They are classified into following −Arithmetic operators.Relational operators.Logical operators.Assignment operators.Increment and decrement operators.Bitwise operators.Conditional operators.Special operators.Arithmetic operatorThese operators are used for numerical calculations (or) to perform arithmetic operations like addition, subtraction etc.OperatorDescriptionExamplea=20, b=10Output+Additiona+b20+1030-subtractiona-b20-1010*multiplicationa*b20*10200/Divisiona/b20/102(quotient)%Modular Divisiona%b20%100 (remainder)ProgramFollowing is the C program for arithmetic operator −#include ... Read More

Advertisements