Example exit modular program, MATLAB in Engineering

Example Exit modular program:

In the illustration below, the user

  •  Chose the Limit;

-   Whenever prompted for n, entered the two invalid values before finally entering a valid positive integer.

  •  Chose the Exit Program.

>> eapplication

Enter a positive integer for n: -4

Invalid! Enter a positive integer: 5.5

Invalid! Enter a positive integer: 10

An approximation of e with n = 10 is 2.59

In order to view the distinction in the approximate value for e as n increases, the user kept choosing Limit & entering larger and larger values each time in the illustration below:

>> eapplication

Enter a positive integer for n: 4

An approximation of e with n = 4 is 2.44

Enter a positive integer for n: 10

An approximation of e with n = 10 is 2.59

Enter a positive integer for n: 30

An approximation of e with n = 30 is 2.67

Enter a positive integer for n: 100

An appoximation of e with n = 100 is 2.70

Posted Date: 10/19/2012 8:40:40 AM | Location : United States







Related Discussions:- Example exit modular program, Assignment Help, Ask Question on Example exit modular program, Get Answer, Expert's Help, Example exit modular program Discussions

Write discussion on Example exit modular program
Your posts are moderated
Related Questions
Modular programs: In a modular program, the answer is broken down into modules, and each is executed as a function. The script is usually known as the main program. In orde

Gauss-Jordan: The Gauss-Jordan elimination technique begins in similar way which the Gauss elimination technique does, but then rather than of back-substitution, the eliminati

calcrectarea subfunction: function call: area = calcrectarea(len,wid); function header: function area = calcrectarea(len, wid)   In the function call, the two arg

Passing arguments to functions: In all these functions examples faraway, at least one of the arguments was passed in the function call to be the value(s) of the equivalent inp

Finding products by for loop: an illustration, when 5 is passed to be the value of the input argument n, the function will compute and return 1 + 2 + 3 + 4 + 5, or 15: >> s

Function strncmp: The function strncmp compares only the first n characters in the strings and ignores the rest. The initial two arguments are strings to compare, and third ar

Example of Plotting from a Function: For illustration, the function can be called as shown below:      >> y = [1:2:9].^3      y =     1  27  125  343  729

Interchange rows : for illustration interchanging rows ri and rj is written as

Illustration of Gauss elimination: For illustration, for a 2 × 2 system, an augmented matrix be: Then, the EROs is applied to obtain the augmented matrix into an upper

FOR Loop: The for loop, or the for statement, is used whenever it is essential to repeat statement(s) in the script or function, and whenever it is known ahead of time how man