Explore BrainMass
Share

Explore BrainMass

    Nesting in a Program

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I am in the process of learning C programming and would like to know when nesting makes a program peform better and when it could make it worse?

    © BrainMass Inc. brainmass.com October 9, 2019, 11:30 pm ad1c9bdddf
    https://brainmass.com/computer-science/debugging/nesting-program-258531

    Solution Preview

    Hi,

    Nesting is a form of putting functions within a function. This enables a program to do multiple combination of functions to run within a single function.

    An advantage of nesting is it makes the program more powerful. For example, nested IF statements like comparing numbers:

    if (num != 0) {
    if (value > 0)
    printf("%d is greater than zero" num);
    else
    out.println("%d is greater than zero " ...

    Solution Summary

    This solution provides a detailed, step-by-step explanation to the given problem.

    $2.19