web analytics

Explain or Discuss function call.

Function call : In order to use functions user need to invoke it at a required place in the program. This is known as the function call. A function can be called by simply using the function name followed by a list of actual parameters, if any, enclosed in parentheses. Example :  int function mul(int x, … Read more

Explain or Describe function definition.

Function Definition:  The function definition is an independent program module that is specially written to implement to the requirements of the function. A function definition, also known as function implementation shall include the following elements Function name Function type List of parameters Local variable declarations Function statements A return statement All the six elements are … Read more

Compare among the three loops. FOR loop VS WHILE loop VS DO….WHILE

Comparison among the three loop:  The comparison among the three types of loops for loop, while loop and do….while loop is given below. Suggested Reading: What are the entry controlled and exist controlled loops? What are the counter controlled and sentinel controlled loops? No. Topics For loop While loop Do…while loop 01 Initialization of condition variable In … Read more

What are the counter and sentinel controlled loops?

counter-controlled-sentinel-controlled-loops

Based on the nature of the control variable and the condition or limit, the loops can be of two general categories; counter controlled and sentinel controlled loops. Counter controlled loops are where we know the number of loop executions beforehand. Unlike counter controlled loops, in sentinel controlled loops the number of loop executions in unknow at the beginning and depends on decisions made inside the loop.

Write down the initialization of two dimensional array

Initialization of two dimensional array : Like the one dimensional arrays, two dimensional arrays may be initialized by following their declaration with a list of initial values enclosed in braces. For example,                    int table[2][3]={0,0,0,1,1,1}; This initializes the elements of the first row to 0 and the second row to 1. This statement can also be … Read more