Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using if statement with AND logie: Different types of logical conditions can be used in if statement with two or more conditions. How you can

image text in transcribed
Using if statement with AND logie: Different types of logical conditions can be used in if statement with two or more conditions. How you can define multiple conditions in if statement using AND logic is shown in the following example. & &is used to apply AND logic of if statement. Create a file named ir AND.sh. In the code, the value of username and password variables will be taken from the user and compared with 'admin' and secret. If both values match then the output will be "valid user", otherwise the output will be "invalid user" oin hasl echo "Enter usemame read username echo "Enter password" read passwoed if username equal admin and password equal secret, then echo opt 1. Using if statement with logical OR #lbinbash echo "Enter any number" read n Hifn is not equal to 150R n not equal to 45 then echo "You won the game echo "You lost the game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Are the rules readily available?

Answered: 1 week ago