![]() Sub-procedures are similar to functions but they don't return any value. Functionsįunctions return a value when they are called. Usually Procedures are written when multiple calls are required to same set of statements which increases re-usuability and modularity. Procedure is a sub-routine which contains set of statements. Do-while Do conditional-expression Procedures While While conditional-expressionĮnd While 4. Select Case Select expressionĮnd Select Loops 1. Nested-If If(conditional-expression)ThenĮnd If 5. 'code if the above conditional-expression is falseĮnd If 4. 'code if the above conditional-expression is true Pseudocode to Calculate Area and Perimeter of Rectangle Recent Posts. Write a C Console Application program that takes the radius of a circle as input and calculate the perimeter and area of the circle. To find the area of a rectangle or a square you need to multiply the length and the width of a rectangle. C,Windows Form, WPF, LINQ, Entity Framework Examples and Codes. I also renamed the function since your function calculates the area and nothing is set, I thought calculatearea() would be a more descriptive name. If-else-if ladder If(conditional-expression)Then In this example, we’ll learn How to calculate area and perimeter of a rectangle in C WinForm. import math def calculatearea(radius): return math.pi radius 2 Note that your function doesnt use or need a myarea argument either. 'code if the conditional-expression is falseĮnd If 3. 'code if the conditional-expression is true Simple syntax of Variable declaration is as follows Dim variableName dataType ] Variable initialization variableName = value Conditional Statements 1. Variable is a name given to the storage area in order to identify them in our programs. User friendly language and easy to develop GUI based applications. ![]() where a, b and c are lengths of sides of triangle, and.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |