Posts

Showing posts from March, 2020

See a problem in else if statement

Dangling else problem

Image
Hello, This problem comes when we use else if statement and do some mistake more describe is given below......... Dangling else problem: One of the major problem with nested if is dangling else problem. The problem arises when both outer if statement inner if statement might pair with common else statement. Thus the compiler is not able to judge to pair the else with which statement. The solution to this problem is given by the compiler that it pairs else with the recent if thus sometimes giving wrong result.                                           Hence the programmer should put early bracket wherever required. This post is may very short because my only aim was to describe this problem. Thank you, Keep supporting............. 

Call by value and call by reference

hello friends here i will tell you what is call by value and call by reference, This is a topic of function,This topic will be used in c programming too much. Call by value: We had been calling function and passing arguments to them using call by value method.In the call by value method ,the called function creates new variables to store  the value of the argument passed to it.Therefore the called function uses a copy of the actual argument to perform its intended task.  If the called function is supposed to modify the value of the parameters passed to it,then the change will be reflected only in the called function.In the calling function no change will be made to the value of the variables.This is because all the changes were made to the copy of the variable and not to the actual variables.   to understand this concept the code given below.The add( ) function accepts an integer variable num and adds 10 to it.In the calling function ,the value of  num=2.In add( ),the value