পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Tuesday, January 31, 2017

Elixir - Decision Making

Decision making structures require that the programmer specifies one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.
Following is the general from of a typical decision making structure found in most of the programming language:

Elixir provides if/else conditional constructs like many other programming languages. It also has a cond statement which calls the first true value it finds. Case is another control flow statement which uses pattern matching to control the flow of the program. Let's have a deep look at them.
Elixir provides the following types of decision making statements. Click the following links to check their detail.
S. No. Statement and Description
1 if statementAn if statement consists of a Boolean expression followed by do, one or more executable statements and finally an end keyword. Code in if statement executes only if boolean condition evaluates to true.
2 if..else statementAn if statement can be followed by an optional else statement(within the do..end block), which executes when the Boolean expression is false.
3 unless statementAn unless statement has the same body as an if statement. The code within unless statement executes only when the condition specified is false.
4 unless..else statementAn unless..else statement has the same body as an if..else statement. The code within unless statement executes only when the condition specified is false.
5 condA cond statement is used where we want to execute code on basis of several conditions. It kind of works like an if...else if….else construct in several other programming languages.
6 caseCase statement can be considered as a replacement for switch statement in imperative languages. Case takes a variable/literal and applies pattern matching to it with different cases. If any case matches, elixir executes code associated with that case and exits case statement.

No comments:

Post a Comment