The document discusses conditional statements in C# including if, if-else, nested if statements, and switch-case statements. It covers:
- Comparison and logical operators that are used to compose logical conditions for conditional statements
- How the if and if-else statements provide conditional execution of code blocks based on evaluating conditions
- Nested if statements allow creating more complex logic by placing if statements inside other if or else blocks
- The switch-case statement selects code for execution depending on the value of an expression, making it useful for multiple comparisons
Detailing about basics of C language and its control structure for learning C Language for beginners. It covers looping statement , control statement etc.
Control structures in C++ Programming LanguageAhmad Idrees
The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and ... Note: This page does not list esoteric programming languages. .... Computer programming portal ...
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.
Shown below is the general form of a typical decision-making structure found in most of the programming languages:
Detailing about basics of C language and its control structure for learning C Language for beginners. It covers looping statement , control statement etc.
Control structures in C++ Programming LanguageAhmad Idrees
The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and ... Note: This page does not list esoteric programming languages. .... Computer programming portal ...
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.
Shown below is the general form of a typical decision-making structure found in most of the programming languages:
This page contains examples and source code on decision making in C programming (to choose a particular statement among many statements) and loops ( to perform repeated task ). To understand all the examples on this page, you should have knowledge of following topics:
if...else Statement
for Loop
while Loop
break and Continue Statement
switch...case
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
Types of Statements in Python Programming LanguageExplore Skilled
The slide describes the types of flow control statements in Python including conditional statement , loop statement , control statement such as break and continue .
This page contains examples and source code on decision making in C programming (to choose a particular statement among many statements) and loops ( to perform repeated task ). To understand all the examples on this page, you should have knowledge of following topics:
if...else Statement
for Loop
while Loop
break and Continue Statement
switch...case
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
Types of Statements in Python Programming LanguageExplore Skilled
The slide describes the types of flow control statements in Python including conditional statement , loop statement , control statement such as break and continue .
Со времён С++98 стандартные контейнеры и идиома RAII позволяли избегать использования оператора delete,
что делало код более безопасным. С приходом С++11 и умных указателей отпала необходимость использовать оператор new, что позволило практически полностью переложить управление памятью на плечи компилятора. В
докладе объясняется идеология управления памятью и ресурсами в современном С++.
In this chapter we will cover the conditional statements in C#, which we can use to execute different actions depending on a given condition. We will explain the syntax of the conditional operators if and if-else with suitable examples and explain the practical application of the operator for selection switch-case.
statement in python conditional statement.For more presentation please contact us on raginijain0208@gmail.com.
You get new presentation every Sunday at 10 AM.
Learn more about Python by click on this given below link
Python Introduction- https://www.slideshare.net/RaginiJain21/final-presentation-on-python
Basic concept of Python -https://www.slideshare.net/RaginiJain21/python-second-ppt
Python Datatypes - https://www.slideshare.net/RaginiJain21/data-types-in-python-248466302
Python Library & Module - https://www.slideshare.net/RaginiJain21/python-libraries-and-modules
Basic Python Programs- https://www.slideshare.net/RaginiJain21/basic-python-programs
Python Media Libarary - https://www.slideshare.net/RaginiJain21/python-media-library
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
4. Comparison OperatorsComparison Operators
4
OperatorOperator Notation in C#Notation in C#
EqualsEquals ====
Not EqualsNot Equals !=!=
Greater ThanGreater Than >>
Greater Than or EqualsGreater Than or Equals >=>=
Less ThanLess Than <<
Less Than or EqualsLess Than or Equals <=<=
Example:Example:
bool result = 5 <= 6;bool result = 5 <= 6;
Console.WriteLine(result); // TrueConsole.WriteLine(result); // True
5. Logical OperatorsLogical Operators
De Morgan lawsDe Morgan laws
!!A!!A AA
!(A || B)!(A || B) !A && !B!A && !B
!(A && B)!(A && B) !A || !B!A || !B
OperatorOperator Notation in C#Notation in C#
Logical NOTLogical NOT !!
Logical ANDLogical AND &&&&
Logical ORLogical OR ||||
Logical Exclusive OR (XOR)Logical Exclusive OR (XOR) ^^
5
7. TheThe ifif StatementStatement
The most simple conditional statementThe most simple conditional statement
Enables you to test for a conditionEnables you to test for a condition
Branch to different parts of the codeBranch to different parts of the code
depending on the resultdepending on the result
The simplest form of anThe simplest form of an ifif statement:statement:
if (condition)if (condition)
{{
statements;statements;
}}
7
8. Condition and StatementCondition and Statement
The condition can be:The condition can be:
Boolean variableBoolean variable
Boolean logical expressionBoolean logical expression
Comparison expressionComparison expression
The condition cannot be integer variable (likeThe condition cannot be integer variable (like
in C / C++)in C / C++)
The statement can be:The statement can be:
Single statement ending with a semicolonSingle statement ending with a semicolon
Block enclosed in bracesBlock enclosed in braces
8
9. How It Works?How It Works?
The condition is evaluatedThe condition is evaluated
If it is true, the statement is executedIf it is true, the statement is executed
If it is false, the statement is skippedIf it is false, the statement is skipped
truetrue
conditioncondition
statementstatement
falsefalse
9
10. TheThe ifif Statement – ExampleStatement – Example
10
static void Main()static void Main()
{{
Console.WriteLine("Enter two numbers.");Console.WriteLine("Enter two numbers.");
int biggerNumber = int.Parse(Console.ReadLine());int biggerNumber = int.Parse(Console.ReadLine());
int smallerNumber = int.Parse(Console.ReadLine());int smallerNumber = int.Parse(Console.ReadLine());
if (smallerNumber > biggerNumber)if (smallerNumber > biggerNumber)
{{
biggerNumber = smallerNumber;biggerNumber = smallerNumber;
}}
Console.WriteLine("The greater number is: {0}",Console.WriteLine("The greater number is: {0}",
biggerNumber);biggerNumber);
}}
12. TheThe if-elseif-else StatementStatement
More complex and useful conditional statementMore complex and useful conditional statement
Executes one branch if the condition is true, andExecutes one branch if the condition is true, and
another if it is falseanother if it is false
The simplest form of anThe simplest form of an if-elseif-else statement:statement:
if (expression)if (expression)
{{
statement1;statement1;
}}
elseelse
{{
statement2;statement2;
}}
12
13. How It Works ?How It Works ?
The condition is evaluatedThe condition is evaluated
If it is true, the first statement is executedIf it is true, the first statement is executed
If it is false, the second statement is executedIf it is false, the second statement is executed
conditioncondition
firstfirst
statementstatement
truetrue
secondsecond
statementstatement
falsefalse
13
14. if-elseif-else Statement – ExampleStatement – Example
Checking a number if it is odd or evenChecking a number if it is odd or even
string s = Console.ReadLine();string s = Console.ReadLine();
int number = int.Parse(s);int number = int.Parse(s);
if (number % 2 == 0)if (number % 2 == 0)
{{
Console.WriteLine("This number is even.");Console.WriteLine("This number is even.");
}}
elseelse
{{
Console.WriteLine("This number is odd.");Console.WriteLine("This number is odd.");
}}
14
17. NestedNested ifif StatementsStatements
ifif andand if-elseif-else statements can bestatements can be nestednested, i.e. used, i.e. used
inside anotherinside another ifif oror elseelse statementstatement
EveryEvery elseelse corresponds to its closest precedingcorresponds to its closest preceding ifif
if (expression)if (expression)
{{
if (expression)if (expression)
{{
statement;statement;
}}
elseelse
{{
statement;statement;
}}
}}
elseelse
statement;statement;
17
18. NestedNested ifif – Good Practices– Good Practices
Always useAlways use {{ …… }} blocks to avoid ambiguityblocks to avoid ambiguity
Even when a single statement followsEven when a single statement follows
Avoid using more than three levels of nestedAvoid using more than three levels of nested
ifif statementsstatements
Put the case you normally expect to processPut the case you normally expect to process
first, then write the unusual casesfirst, then write the unusual cases
Arrange the code to make it more readableArrange the code to make it more readable
18
19. NestedNested ifif Statements – ExampleStatements – Example
if (first == second)if (first == second)
{{
Console.WriteLine(Console.WriteLine(
"These two numbers are equal.");"These two numbers are equal.");
}}
elseelse
{{
if (first > second)if (first > second)
{{
Console.WriteLine(Console.WriteLine(
"The first number is bigger.");"The first number is bigger.");
}}
elseelse
{{
Console.WriteLine("The second is bigger.");Console.WriteLine("The second is bigger.");
}}
}}
19
21. Multiple if-else-if-else-…Multiple if-else-if-else-…
Sometimes we need to use anotherSometimes we need to use another ifif--
construction in theconstruction in the elseelse blockblock
ThusThus else ifelse if can be used:can be used:
21
int ch = 'X';int ch = 'X';
if (ch == 'A' || ch == 'a')if (ch == 'A' || ch == 'a')
{{
Console.WriteLine("Vowel [ei]");Console.WriteLine("Vowel [ei]");
}}
else if (ch == 'E' || ch == 'e')else if (ch == 'E' || ch == 'e')
{{
Console.WriteLine("Vowel [i:]");Console.WriteLine("Vowel [i:]");
}}
else if …else if …
else …else …
24. TheThe switch-caseswitch-case StatementStatement
Selects for execution a statement from a listSelects for execution a statement from a list
depending on the value of thedepending on the value of the switchswitch
expressionexpression
switch (day)switch (day)
{{
case 1: Console.WriteLine("Monday"); break;case 1: Console.WriteLine("Monday"); break;
case 2: Console.WriteLine("Tuesday"); break;case 2: Console.WriteLine("Tuesday"); break;
case 3: Console.WriteLine("Wednesday"); break;case 3: Console.WriteLine("Wednesday"); break;
case 4: Console.WriteLine("Thursday"); break;case 4: Console.WriteLine("Thursday"); break;
case 5: Console.WriteLine("Friday"); break;case 5: Console.WriteLine("Friday"); break;
case 6: Console.WriteLine("Saturday"); break;case 6: Console.WriteLine("Saturday"); break;
case 7: Console.WriteLine("Sunday"); break;case 7: Console.WriteLine("Sunday"); break;
default: Console.WriteLine("Error!"); break;default: Console.WriteLine("Error!"); break;
}}
24
25. HowHow switch-caseswitch-case Works?Works?
1.1. The expression is evaluatedThe expression is evaluated
2.2. When one of the constants specified in a caseWhen one of the constants specified in a case
label is equal to the expressionlabel is equal to the expression
The statement that corresponds to that caseThe statement that corresponds to that case
is executedis executed
1.1. If no case is equal to the expressionIf no case is equal to the expression
If there is default case, it is executedIf there is default case, it is executed
Otherwise the control is transferred to theOtherwise the control is transferred to the
end point of the switch statementend point of the switch statement
25
27. UsingUsing switchswitch: Rules: Rules
Variables types likeVariables types like stringstring,, enumenum and integraland integral
types can be used fortypes can be used for switchswitch expressionexpression
The valueThe value nullnull is permitted as a case labelis permitted as a case label
constantconstant
The keywordThe keyword breakbreak exits the switch statementexits the switch statement
"No fall through" rule – you are obligated to use"No fall through" rule – you are obligated to use
breakbreak after each caseafter each case
Multiple labels that correspond to the sameMultiple labels that correspond to the same
statement are permittedstatement are permitted
27
28. Multiple Labels – ExampleMultiple Labels – Example
switch (animal)switch (animal)
{{
case "dog" :case "dog" :
Console.WriteLine("MAMMAL");Console.WriteLine("MAMMAL");
break;break;
case "crocodile" :case "crocodile" :
case "tortoise" :case "tortoise" :
case "snake" :case "snake" :
Console.WriteLine("REPTILE");Console.WriteLine("REPTILE");
break;break;
default :default :
Console.WriteLine("There is no such animal!");Console.WriteLine("There is no such animal!");
break;break;
}}
You can use multiple labels to execute the sameYou can use multiple labels to execute the same
statement in more than one casestatement in more than one case
28
30. UsingUsing switchswitch – Good Practices– Good Practices
There must be a separateThere must be a separate casecase for everyfor every
normal situationnormal situation
Put the normal case firstPut the normal case first
Put the most frequently executed cases firstPut the most frequently executed cases first
and the least frequently executed lastand the least frequently executed last
Order cases alphabetically or numericallyOrder cases alphabetically or numerically
InIn defaultdefault use case that cannot be reacheduse case that cannot be reached
under normalunder normal circumstancescircumstances
30
31. SummarySummary
Comparison and logical operators are used toComparison and logical operators are used to
compose logical conditionscompose logical conditions
The conditional statementsThe conditional statements ifif andand if-elseif-else
provide conditional execution of blocks of codeprovide conditional execution of blocks of code
Constantly used in computer programmingConstantly used in computer programming
Conditional statements can be nestedConditional statements can be nested
TheThe switchswitch statement easily and elegantlystatement easily and elegantly
checks an expression for a sequence of valueschecks an expression for a sequence of values
31
33. ExercisesExercises
1.1. Write anWrite an ifif statement that examines two integerstatement that examines two integer
variables and exchanges their values if the first onevariables and exchanges their values if the first one
is greater than the second one.is greater than the second one.
2.2. Write a program that shows the sign of the productWrite a program that shows the sign of the product
of three real numbers without calculating it. Use aof three real numbers without calculating it. Use a
sequence of if statements.sequence of if statements.
3.3. Write a program that finds the biggest of threeWrite a program that finds the biggest of three
integers using nested if statements.integers using nested if statements.
4.4. SortSort 33 real values in descending order using nested ifreal values in descending order using nested if
statements.statements.
33
34. Exercises (2)Exercises (2)
5.5. Write program that asks for a digit and dependingWrite program that asks for a digit and depending
on the input shows the name of that digit (inon the input shows the name of that digit (in
English) using a switch statement.English) using a switch statement.
6.6. Write a program that enters the coefficientsWrite a program that enters the coefficients aa,, bb andand
cc of a quadratic equationof a quadratic equation
a*xa*x22
++ b*xb*x ++ cc == 00
and calculates and prints its real roots. Note thatand calculates and prints its real roots. Note that
quadratic equations may havequadratic equations may have 00,, 11 oror 22 real roots.real roots.
Write a program that finds the greatest of givenWrite a program that finds the greatest of given 55
variables.variables.
34
35. Exercises (3)Exercises (3)
8.8. Write a program that, depending on the user'sWrite a program that, depending on the user's
choice inputschoice inputs intint,, doubledouble oror stringstring variable. If thevariable. If the
variable is integer or double, increases it with 1. Ifvariable is integer or double, increases it with 1. If
the variable is string, appends "the variable is string, appends "**" at its end. The" at its end. The
program must show the value of that variable as aprogram must show the value of that variable as a
console output. Useconsole output. Use switchswitch statement.statement.
9.9. We are given 5 integer numbers. Write a programWe are given 5 integer numbers. Write a program
that checks if the sum of some subset of them isthat checks if the sum of some subset of them is 00..
Example:Example: 33,, -2-2,, 11,, 11,, 88 1+1-2=01+1-2=0..
35
36. Exercises (4)Exercises (4)
10.10. Write a program that applies bonus scores to givenWrite a program that applies bonus scores to given
scores in the range [1..9]. The program reads a digitscores in the range [1..9]. The program reads a digit
as an input. If the digit is between 1 and 3, theas an input. If the digit is between 1 and 3, the
program multiplies it by 10; if it is between 4 and 6,program multiplies it by 10; if it is between 4 and 6,
multiplies it by 100; if it is between 7 and 9,multiplies it by 100; if it is between 7 and 9,
multiplies it by 1000. If it is zero or if the value is notmultiplies it by 1000. If it is zero or if the value is not
a digit, the program must report an error.a digit, the program must report an error.
Use aUse a switchswitch statement and at the end print thestatement and at the end print the
calculated new value in the console.calculated new value in the console.
36
37. Exercises (5)Exercises (5)
11.11. * Write a program that converts a number in the* Write a program that converts a number in the
range [0...999] to a text corresponding to itsrange [0...999] to a text corresponding to its
English pronunciation. Examples:English pronunciation. Examples:
00 ""ZeroZero""
273273 "Two hundred seventy three""Two hundred seventy three"
400400 "Four hundred""Four hundred"
501501 ""Five hundred and oneFive hundred and one""
711711 "Severn hundred and eleven""Severn hundred and eleven"
37