C Language Question set number set number 00001

In nested if statements, when a single “else clause” occurs, the situation happens to be dangling else! For example:

    if (condition)
        if (condition)
	    if (condition)
    else
        printf("dangling else!n");  /* dangling else, as to which if statement, else clause associates */

1. In such situations, else clause belongs to the closest if statement which is incomplete that is the innermost if statement!
2. However, we can make else clause belong to desired if statement by enclosing all if statements in block outer to which if statement to associate the else clause. For example:

    if (condition) {
        if (condition)
            if (condition)
    } else
        printf("else associates with the outermost if statement!n");

Synopsis and Project Report

You can buy synopsis and project from distpub.com. Just visit https://distpub.com/product-category/projects/ and buy your university/institute project from distpub.com

ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.