Posts

Showing posts from September, 2016

User defined Function

Image
" Function is defined as a group of statements that together perform a specific task. " - Main() is a function, therefore every C++ program should have at least one function. - Function is divided into 3 part           1 - function declaration          2 - function definition          3 - function call  - A function declaration tells the compiler about a function's name, return type, and parameters. - A function definition means body of the function. - A function call  is a part of main programs and it specified which function should be called. Example - There are four possible style to write a function in your program - 1- void function with no argument                      e.g- 2- void function  with argument         ...

Call By Value & Call By Reference

Image
FORMAL PARAMETER - These are the parameters which appear in the function definition or declaration is called Formal Parameter.  ACTUAL PARAMETER - These are the parameters which appear in the function call is called Actual Parameter. Call By Value - In Call By Value , value of actual parameter is copied into Formal Parameter. The function work on formal parameter only. Actual parameter is intact. Change are not reflected is called function. Call By Reference -  In this type, instead of copying a value of actual parameters into formal parameter, the function receive address of the actual parameter. Works on the original value, Changes are reflected in the calling function. Summary -    By - Somesh Sah

Nested Loop

Image
"In Computer Science a nested loop is a loop within a loop, an inner loop within the body of an outer loop." How this works is that the first pass of the outer loop triggers the inner loop, which executes to completion. Then the second pass of the outer loop triggers the inner loop again.  This repeats until the outer loop finishes. 0r In Simple Words -  consider yo have to plot a graph , so you need (x,y) point... Similarly the outer for loops provide you x values and the inner for loop provides y values. Of course, a break within either the inner or outer loop would interrupt this process. The concept of Nested loop is very Important. Nested loop is very useful in Advance programming. Syntax - For Example - Please watch this video ...to understand nested loop clearly. Generally Nested Loops used in pattern programming... Please follow this link - http://www.programiz.com/article/c%2B%2B-programming-pattern ...

Loop Statement Programs

Image
  " In computer programming, a loop is a sequence of instruction that is continually repeated until a certain condition is reached " There are three types of loops ♣ for loop ♣ while loop ♣ do while loop FOR LOOP Defination - For loop is used for counting purpose. - For loop is divided into three parts 1- initialization 2-  condition 3- increment/decrement Initialization is that part of the loop where counting starts. Condition is that part of the loop which defines the end point of the counting till it satisfy the parameter(condition) Increment/Decrement is that part of the loop which defines the order of counting in increment/decrement order. Syntax of for loop for(initialization; condition; increment/decrement) { Statements ; } Programming (Example) Ques - Display the number from 0 to 9 using for loop Output WHILE LOOP - WHILE loops are very simple. - If conditions is true ...