Friday, 7 August 2026

R Basics

 Module I:

 R Introduction – R Advantages and Disadvantages – R Installation – RStudio IDE – R Basics – R Basic Syntax – R Data Types – R Variables – R Keyword – R Operators

Module - II:

 R Control structures – R If statements – R if else, R else if statements, R switch - R Looping statements – R For loop – R while Loop – R Repeate Loop 

Module – III:

 R data structures – R vectors – R arrays – R Matrix – R Data Frame – R Factors – R Graphics – R Plot – R Line – R Scatter Plot – R pie charts – R Histogram – R Bars

 R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by the R Development Core Team. R is freely available under the GNU General Public License.

 R Programming is a programming language and software environment designed for statistical computing, data analysis, and visualization. It is widely used by statisticians, data scientists, researchers, and analysts.

--------------------------------

Features of R:-

------------

•Open-source and free to use. 

•Excellent for statistical analysis and mathematical computations. 

•Powerful data visualization with libraries like ggplot2. 

•Large collection of packages through CRAN. 

•Supports machine learning, data mining, and predictive analytics. 

•Works on Windows, macOS, and Linux. 


Applications of R:-

----------------

•Data analysis and visualization 

•Statistical modeling 

•Machine learning 

•Bioinformatics 

•Financial analysis 

•Research and academic projects 

•Business analytics 


Basic Data Types:

---------------

-Basic data types in R can be divided into the following types:

1) numeric - (10.5, 55, 787)

2) integer - (1L, 55L, 100L, where the letter "L" declares this as an integer)

3) complex - (9 + 3i, where "i" is the imaginary part)

4) character (a.k.a. string) - ("k", "R is exciting", "FALSE", "11.5")

5) logical (a.k.a. boolean) - (TRUE or FALSE)Basic Data Types


Common Data Structures:-

-------------------

•Vector 

•Matrix 

•Array 

•List 

•Data Frame 

•Factor

------------------------------ 

Note: 

----- 

1) print(c) 

2) message(c) -- not showing args no. 

3) cat(c)     -- not showing args no. 

4) print("Result is :",c)  --> invalid 

5) cat("Result is :",c) 

6) message("Result is :",c) 

7) paste("a :",a," b:",b," c:",c) - concatenate 

9) math function : max,min,sqrt,abs,ceiling,floor 

----------------

#program 1 : display your name

print("welcome")            --- with args

print("hi")

------------------

#program 2 : display your name

message("welcome")

message("hi")

---------------

#Program 3 : Display string

a="welcome"

message(a)

--------------------

#Program 4: Display integer

a=10

print(a)

#print("a is",a)  --- Error

message("a is =",a)

-----------------------

#Program 5 : Display integer

a=10

b=20

message("a is =",a," b is =",b)

-------------------------------

#Program 6: display integer

a<-10

message("a is :",a)

---------------------

#Program 7: display floating point(numeric)

a<-10.5546

message("a is :",a)

---------------------

#Program 8: display floating point

a<-10.5546

x1=sprintf(a, fmt = '%#.2f')

message("Result is:",x1)

---------------------

#Program 9: display Boolean

a<-TRUE

b<-FALSE

message(a)

message(b)

-----------------------

#Program 10: display complex

a<-10+2i

message(a)

-----------------

#Program 11: print multiple values

a<-b<-c<-10

message("a =",a)

message("b =",b)

message("c =",c)

-------------------

#Program 12:display Type

a<-10

print(typeof(a))

b<-10L

print(typeof(b))

c<10.5

print(typeof(c))

d<-"jahab"

print(typeof(d))

a<-TRUE

print(typeof(a))

a<-2+3i

print(typeof(a))

--------------------

##Program 13:display type

a<-10

b<-20.5

c<-"jahab"

print(class(a))

print(class(b))

print(class(c))

------------------

#Program 14:check type

a<-10

b<-10.5

c<-"jahab"

d<-TRUE

e<-2+3i


print(is.integer(a))

print(is.numeric(b))

print(is.character(c))

print(is.logical(d))

print(is.complex(e))

----------------------

#Program 14:Addition of two integer number

a<-10

b<-20

c=a+b

print(c)

#print("Result is",c) -----------error

message("Result is:",c)------------without args

---------------------------

#Program 15:Addition of two numeric number

a<-10.335

b<-20.45454

c=a+b

print("result is :",c)

-----------------------

#Program 16

a<-10.335

b<-20.45454

c=a+b

x1=sprintf(c, fmt = '%#.2f')

message("Result is:",x1)

-------------------------

#Program 17: addition of two complex numbers

a<-10+5i

b<-2+3i

c=a+b

message("complex addition:",c)

---------------------------------

#Program 18 : using maths function

a<-25

message("root is:",sqrt(a))

message(ceiling(10.3))   --- next integer

message(floor(10.3))     --- previous 

message(abs(-13))        ---- -ve to +ve

message("round is:",round(10.3434))----whole

max(5, 10, 15)

min(5, 10, 15)

------------------------

1) getwd()      # See current working directory

2) setwd("C:/path/to/folder")  # Change working directory

3) source("script.R")


#Program 1: get and print string without prompt

name<-readline()

message("output is :",name)


#Program 2: get and print string with prompt keyword

name<-readline(prompt="Enter your name:")

message("output is :",name)


#Program 3: get and print string(prompt - optional)

name<-readline("Enter your name:")

message("output is :",name)


#Program 4: get and print integer value(method-1)

a<-readline("Enter a :")

a<-as.integer(a)

message("Output is :",a)


#Program 5: get and print integer value(method-2)

a<-as.integer(readline("Enter a :"))

message("Output is :",a)


#Program 6: get and print numeric

a<-as.numeric(readline("Enter a :"))

message("Output is :",a)


#Program 7: get and print char

a<-as.character(readline("Enter a :"))

message("Output is :",a)

-----------------------------------------

#Program8: Addition of two numbers(integer) 

a=as.integer(readline("Enter a :")) 

b=as.integer(readline("Enter b :")) 

c=a+b 

print(c) 

-------------------------------- 

(or) 

a<-as.integer(readline("Enter a :")) 

b<-as.integer(readline("Enter b :")) 

c<-a+b 

print(c) 

(or)

a<-as.integer(readline(prompt="Enter a :")) 

b<-as.integer(readline(prompt="Enter b :")) 

c<-a+b 

print(c) 

(or) 

a<-as.integer(readline("Enter a :")) 

b<-as.integer(readline("Enter b :")) 

c<-a+b 

message(paste("a :",a," b:",b," c:",c)) 

----------------------------------- 

#Program9 : Addition of two numbers(float) 

a=as.numeric(readline("Enter a :")) 

b=as.numeric(readline("Enter b :")) 

c=a+b 

print(c) 

------------------------- 

#Program10 : division of two numbers 

a=as.integer(readline("Enter a :")) 

b=as.integer(readline("Enter b :")) 

c=a/b       #floating division 

print(c) 

-------------------------- 

#Program11 : division of two numbers 

a=as.numeric(readline("Enter a :")) 

b=as.numeric(readline("Enter b :")) 

c=a/b   #floating division 

print(c) 

------------------------- 

#Program12 : division of two numbers 

a=as.numeric(readline("Enter a :")) 

b=as.numeric(readline("Enter b :")) 

c=a%/%b   #integer division  

print(c) 

-------------------------- 

#Program13 : remainder 

a=as.numeric(readline("Enter a :")) 

b=as.numeric(readline("Enter b :")) 

c=a%%b    

print(c) 

---------------------------

#Program14 : find volume

r<-as.numeric(readline("Enter radious value :"))

h<-as.numeric(readline("Enter height value :"))

v=(1/3)*3.14*r*r*h

message("volume is :",v)

-----------------------------

Bootstrap

 Bootstrap:-

------------

-it's a popular open-source(free) front-end framework used to build responsive Web design

-mobile-first websites quickly.

-Bootstrap (the front-end CSS framework)


Responsive Web design:

--------------------------------

* Responsive web design is about creating web sites which automatically adjust themselves to look good on all devices, from small phones to large desktops.


History of Bootstrap:-

-----------------------

*2010 – Bootstrap was created by Mark Otto and Jacob Thornton while working at Twitter. It was initially called Twitter Blueprint and was developed to make web interfaces more consistent across projects.


*August 2011 – Bootstrap was released as an open-source project under the MIT License. It quickly became popular because it made responsive web design easier.


*Bootstrap 2 (2012) – Introduced built-in responsive design, allowing websites to adapt to different screen sizes such as desktops, tablets, and phones.


*Bootstrap 3 (2013) – Adopted a mobile-first approach, meaning layouts were designed for mobile devices first and then enhanced for larger screens. It also introduced the 12-column responsive grid system that became widely used.


*Bootstrap 4 (2018) – Replaced Less with Sass, introduced Flexbox for improved layouts, and modernized many components and utilities.


*Bootstrap 5 (2021) – Removed the dependency on jQuery, added more utility classes, improved customization, enhanced RTL (right-to-left) support, and updated components for modern web development.


Features:-

-----------

*Responsive Grid System: 12-column layout for creating responsive designs.

*Prebuilt Components: Buttons, cards, modals, navbars, alerts, forms, carousels, and more.

*Utility Classes: Easily control spacing, colors, typography, display, flexbox, etc.

*JavaScript Components: Interactive elements like dropdowns, tooltips, accordions, and modals.


Why Use Bootstrap?

*Faster web development.

*Mobile-first responsive design.

*Consistent UI across browsers.

*Large community and extensive documentation.

*Easy customization.


Common Bootstrap Classes:-

------------------------------------

Purpose      Example

-------------     -----------------

*Container : container, container-fluid

*Grid : row, col, col-md-6

*Buttons : btn, btn-primary, btn-danger

*Text : text-center, text-primary, fw-bold

*Spacing : m-3, mt-4, p-2

*Colors : bg-success, bg-warning, text-white

*Flexbox : d-flex, justify-content-center, align-items-center

------------------------------------------------------

1. Container:-

  --------------

-A container is used to wrap your content and provide proper alignment and responsive padding. 

-Bootstrap provides three main types of containers:


1. .container 

2. .container-fluid

3.  Responsive Containers


1. .container : A responsive fixed-width container.

Ex:

<div class="container">

  <h1>Hello Bootstrap</h1>

  <p>This is inside a fixed-width container.</p>

</div>


2. .container-fluid : Always spans the entire width of the screen.

Ex:

<div class="container-fluid">

  <h1>Full Width</h1>

  <p>This container is always 100% wide.</p>

</div>


3. Responsive Containers : These are full-width until the specified breakpoint.

Ex:

<div class="container-sm">Small breakpoint</div>

<div class="container-md">Medium breakpoint</div>

<div class="container-lg">Large breakpoint</div>

<div class="container-xl">Extra large breakpoint</div>

<div class="container-xxl">Extra extra large breakpoint</div>

-------------------------------------------------------------------------------

Program 1: Fixed-width .container

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Bootstrap Container Example</title>


    <!-- Bootstrap CSS -->

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">

</head>

<body>


<div class="container mt-5">

    <h1 class="text-primary">Welcome to Bootstrap</h1>

    <p>This content is inside a Bootstrap container.</p>

    <button class="btn btn-success">Click Me</button>

</div>


</body>

</html>

----------------------------------------

Program 2 : Full-width .container-fluid

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Bootstrap Container Example</title>


    <!-- Bootstrap CSS -->

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">

</head>

<body>


<div class="container-fluid bg-primary text-white p-4">

    <h2>Container Fluid</h2>

    <p>This container takes the full width of the screen.</p>

</div>


</body>

</html>

-----------------------------

Program 3: Responsive containers


<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Responsive Container</title>

  <style>

    body {

      margin: 0;

      font-family: Arial, sans-serif;

      background: #f4f4f4;

    }


    .container {

      width: 90%;

      max-width: 1200px;

      margin: 0 auto;

      padding: 20px;

      background: white;

    }


    .box {

      background: #4CAF50;

      color: white;

      padding: 20px;

      text-align: center;

      margin-top: 20px;

      border-radius: 8px;

    }


    @media (max-width: 768px) {

      .container {

        width: 95%;

        padding: 15px;

      }

    }

  </style>

</head>

<body>


  <div class="container">

    <h1>Responsive Container</h1>

    <div class="box">

      This container adjusts based on screen size.

    </div>

  </div>


</body>

</html>

-------------------------------------

Bootstrap 5 Grid System:

-------------------------------

* Bootstrap's grid system is built with flexbox and allows up to 12 columns across the page.

* If you do not want to use all 12 columns individually, you can group the columns together to create wider columns:


span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1   span 1 span 1

                         span 4                                                               span 4                                               span 4

                                              span 4                                                                                    span 8

                          span 6                                                              span 6

                                                                  span 12

* The grid system is responsive, and the columns will re-arrange automatically depending on the screen size.

* Make sure that the sum adds up to 12 or fewer (it is not required that you use all 12 available columns).


Grid Classes:-

The Bootstrap 5 grid system has six classes:


.col- (extra small devices - screen width less than 576px)

.col-sm- (small devices - screen width equal to or greater than 576px)

.col-md- (medium devices - screen width equal to or greater than 768px)

.col-lg- (large devices - screen width equal to or greater than 992px)

.col-xl- (xlarge devices - screen width equal to or greater than 1200px)

.col-xxl- (xxlarge devices - screen width equal to or greater than 1400px)


Ex:

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>

  

<div class="container-fluid mt-3">

  <h1>Three equal width columns</h1>

  <p>Note: Try to add a new div with class="col" inside the row class - this will create four equal-width columns.</p>

  <div class="row">

    <div class="col p-3 bg-primary text-white">.col</div>

    <div class="col p-3 bg-dark text-white">.col</div>

    <div class="col p-3 bg-primary text-white">.col</div>

  </div>

</div>


</body>

</html>

----------------------------------------------

Ex2:

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>

  

<div class="container-fluid mt-3">

  <h1>Responsive Columns</h1>

  <p>Resize the browser window to see the effect.</p>

  <p>The columns will automatically stack on top of each other when the screen is less than 576px wide.</p>

  <div class="row">

    <div class="col-sm-3 p-3 bg-primary text-white">.col</div>

    <div class="col-sm-3 p-3 bg-dark text-white">.col</div>

    <div class="col-sm-3 p-3 bg-primary text-white">.col</div>

    <div class="col-sm-3 p-3 bg-dark text-white">.col</div>

  </div>

</div>


</body>

</html>

------------------------------------------------

Color

-------

The classes for text colors are: .text-muted, .text-primary, .text-success, .text-info, .text-warning, .text-danger, .text-secondary, .text-white, .text-dark, .text-body (default body color/often black) and .text-light


Ex:

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>

<div class="container mt-3">                         mt-3 - padding top

  <h2>Colors</h2>

  <p class="text-muted">This text is muted.</p>

  <p class="text-primary">This text is important.</p>

  <p class="text-success">This text indicates success.</p>

  <p class="text-info">This text represents some information.</p>

  <p class="text-warning">This text represents a warning.</p>

  <p class="text-danger">This text represents danger.</p>

  <p class="text-secondary">Secondary text.</p>

  <p class="text-dark">This text is dark grey.</p>

  <p class="text-body">Default body color (often black).</p>

  <p class="text-light">This text is light grey (on white background).</p>

  <p class="text-white">This text is white (on white background).</p>

</div>

</body>

</html>


-----------------------------------------------------------------------------------

Button

--------

1. Button class:-

    ---------------

Basic Syntax:  <button class="btn btn-primary">Primary Button</button>


Class Description

-------------------------------

.btn    -     Base button class (required)

.btn-primary   -   Blue primary button

.btn-secondary - Gray secondary button

.btn-success     - Green success button

.btn-danger        -Red danger button

.btn-warning     -Yellow warning button

.btn-info -Light blue info button

.btn-light -Light-colored button

.btn-dark -Dark-colored button

.btn-link -Button styled as a hyperlink

.btn-lg - Large Button

.btn-sm - Small Button

.btn-outline-primary - Outline Primary

.btn-outline-success - Outline Success

.btn-outline-danger - Outline Danger


<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <h2>Button Styles</h2>

  <a href="#" class="btn btn-success">Link Button</a>

  <input type="button" class="btn btn-success" value="Input Button">

  <button type="button" class="btn">Basic</button>

  <button type="button" class="btn btn-primary">Primary</button>

  <button type="button" class="btn btn-secondary">Secondary</button>

  <button type="button" class="btn btn-success">Success</button>

  <button type="button" class="btn btn-info">Info</button>

  <button type="button" class="btn btn-warning">Warning</button>

  <button type="button" class="btn btn-danger">Danger</button>

  <button type="button" class="btn btn-dark">Dark</button>

  <button type="button" class="btn btn-light">Light</button>

  <button type="button" class="btn btn-link">Link</button>   

  <button class="btn btn-primary btn-lg">Large Button</button>

  <button class="btn btn-primary">Default Button</button>

  <button class="btn btn-primary btn-sm">Small Button</button>   

 <button class="btn btn-outline-primary">Outline Primary</button>

 <button class="btn btn-outline-success">Outline Success</button>

 <button class="btn btn-outline-danger">Outline Danger</button>

</div>


</body>

</html>

-------------------------------------

Button group: Bootstrap 5 allows you to group a series of buttons together (on a single line) in a button group:

-----------------

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <div class="btn-group">

    <button type="button" class="btn btn-primary">Apple</button>

    <button type="button" class="btn btn-primary">Samsung</button>

    <button type="button" class="btn btn-primary">Sony</button>

  </div>

</div>


</body>

</html>

-------------------------------

dropdown

------------

*The .dropdown class is used to indicate a dropdown menu.

*Use the .dropdown-menu class to actually build the dropdown menu.

*To open the dropdown menu, use a button or a link with a class of .dropdown-toggle and data-toggle="dropdown"


<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <div class="dropdown">

    <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">

      Dropdown button

    </button>

    <ul class="dropdown-menu">

      <li><a class="dropdown-item" href="#">Link 1</a></li>

      <li><a class="dropdown-item" href="#">Link 2</a></li>

      <li><a class="dropdown-item" href="#">Link 3</a></li>

    </ul>

  </div>

</div>


</body>

</html>

------------------

Multiple drodown

--------------------

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <div class="btn-group">

    <button type="button" class="btn btn-primary">Apple</button>

    <button type="button" class="btn btn-primary">Samsung</button>

    <div class="btn-group">

      <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">Sony</button>

      <ul class="dropdown-menu">

        <li><a class="dropdown-item" href="#">Tablet</a></li>

        <li><a class="dropdown-item" href="#">Smartphone</a></li>

      </ul>

    </div>

  </div>

</div>


</body>

</html>

---------------------------------

spinners:

-----------

-To create a spinner/loader, use the .spinner-border class


Class Description

-------------------------------

spinner-border - Circular rotating border spinner

spinner-grow - Growing/fading spinner

spinner-border-sm - Small border spinner

spinner-grow-sm - Small growing spinner

text-primary, text-success, etc. - Change spinner color

d-none - Hide the spinner


Ex:

<!DOCTYPE html>

<html>

<head>

  <title>Bootstrap Example</title>

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>

<div class="container mt-3">

  <div class="spinner-border"></div>

  <div class="spinner-border text-muted"></div>

  <div class="spinner-border text-primary"></div>

  <div class="spinner-border text-success"></div>

  <div class="spinner-border text-info"></div>

  <div class="spinner-border text-warning"></div>

  <div class="spinner-border text-danger"></div>

  <div class="spinner-border text-secondary"></div>

  <div class="spinner-border text-dark"></div>

  <div class="spinner-border text-light"></div>

  <div class="spinner-grow text-muted"></div>

  <div class="spinner-grow text-primary"></div>

  <div class="spinner-grow text-success"></div>

  <div class="spinner-grow text-info"></div>

  <div class="spinner-grow text-warning"></div>

  <div class="spinner-grow text-danger"></div>

  <div class="spinner-grow text-secondary"></div>

  <div class="spinner-grow text-dark"></div>

  <div class="spinner-grow text-light"></div>

  <div class="spinner-border spinner-border-sm"></div>

  <div class="spinner-grow spinner-grow-sm"></div>

</div>

</body>

</html>

-----------------

spinner buttons:

-----------------

You can also add spinners to a button, with or without text:

Ex:


<!DOCTYPE html>

<html>

<head>

  <title>Bootstrap Example</title>

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <button class="btn btn-primary">

    <span class="spinner-border spinner-border-sm"></span>

  </button>


  <button class="btn btn-primary">

    <span class="spinner-border spinner-border-sm"></span>

    Loading..

  </button>

  

  <button class="btn btn-primary" disabled>

    <span class="spinner-border spinner-border-sm"></span>

    Loading..

  </button>

  

  <button class="btn btn-primary" disabled>

    <span class="spinner-grow spinner-grow-sm"></span>

    Loading..

  </button>

</div>


</body>

</html>

--------------------------------------------

Bootstrap 5 Pagination:-

-If you have a web site with lots of pages, you may wish to add some sort of pagination to each page.


Ex:

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <ul class="pagination">

    <li class="page-item"><a class="page-link" href="#">Previous</a></li>

    <li class="page-item"><a class="page-link" href="#">1</a></li>

    <li class="page-item"><a class="page-link" href="#">2</a></li>

    <li class="page-item"><a class="page-link" href="#">3</a></li>

    <li class="page-item"><a class="page-link" href="#">Next</a></li>

  </ul>

</div>

</body>

</html>

----------------------------------

Nav bar:

---------

-if you want to create a simple horizontal menu, add the .nav


1. nav-tabs - navigation tabs

    Ex: <ul class="nav nav-tabs">

2. nav-pills - active menu

    Ex: <ul class="nav nav-pills">

3. nav-pills with drown

    Ex:  <li class="nav-item dropdown">

4. 

Ex:

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>

<div class="container mt-3">

  <ul class="nav">

    <li class="nav-item">

      <a class="nav-link" href="#">Home</a>

    </li>

    <li class="nav-item">

      <a class="nav-link" href="#">Inbox</a>

    </li>

    <li class="nav-item">

      <a class="nav-link" href="#">Send Items</a>

    </li>

    <li class="nav-item">

      <a class="nav-link disabled" href="#">Disabled</a>

    </li>

  </ul>

</div>


</body>

</html>

------------------------

Ex2: nav-pills with dropdrown


<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <ul class="nav nav-tabs">

    <li class="nav-item">

      <a class="nav-link active" href="#">Active</a>

    </li>

    <li class="nav-item dropdown">

      <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#">Dropdown</a>

      <ul class="dropdown-menu">

        <li><a class="dropdown-item" href="#">Link 1</a></li>

        <li><a class="dropdown-item" href="#">Link 2</a></li>

        <li><a class="dropdown-item" href="#">Link 3</a></li>

      </ul>

    </li>

    <li class="nav-item">

      <a class="nav-link" href="#">Link</a>

    </li>

    <li class="nav-item">

      <a class="nav-link disabled" href="#">Disabled</a>

    </li>

  </ul>

</div>

</body>

</html>

----------------------------------------

Ex3: navbar with dropdown


<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>

<nav class="navbar navbar-expand-sm bg-dark navbar-dark">

  <div class="container-fluid">

    <div class="collapse navbar-collapse" id="collapsibleNavbar">

      <ul class="navbar-nav">

        <li class="nav-item">

          <a class="nav-link" href="#">Home</a>

        </li>

        <li class="nav-item">

          <a class="nav-link" href="#">Aboutus</a>

        </li>

        <li class="nav-item">

          <a class="nav-link" href="#">Message</a>

        </li>  

        <li class="nav-item dropdown">

          <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Dropdown</a>

          <ul class="dropdown-menu">

            <li><a class="dropdown-item" href="#">Link</a></li>

            <li><a class="dropdown-item" href="#">Another link</a></li>

            <li><a class="dropdown-item" href="#">A third link</a></li>

          </ul>

        </li>

      </ul>

    </div>

  </div>

</nav>

<div class="container-fluid mt-3">  

            body content

</div>

</body>

</html>

-----------------------------------

Bootstrap 5 Carousel:

---------------------------

-The Carousel is a slideshow for cycling through elements:


<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<!-- Carousel -->

<div id="demo" class="carousel slide" data-bs-ride="carousel">


  <!-- Indicators/dots -->

  <div class="carousel-indicators">

    <button type="button" data-bs-target="#demo" data-bs-slide-to="0" class="active"></button>

    <button type="button" data-bs-target="#demo" data-bs-slide-to="1"></button>

    <button type="button" data-bs-target="#demo" data-bs-slide-to="2"></button>

  </div>

  

  <!-- The slideshow/carousel -->

  <div class="carousel-inner">

    <div class="carousel-item active">

      <img src="la.jpg" alt="Los Angeles" class="d-block" style="width:100%">

    </div>

    <div class="carousel-item">

      <img src="chicago.jpg" alt="Chicago" class="d-block" style="width:100%">

    </div>

    <div class="carousel-item">

      <img src="ny.jpg" alt="New York" class="d-block" style="width:100%">

    </div>

  </div>

  

  <!-- Left and right controls/icons -->

  <button class="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">

    <span class="carousel-control-prev-icon"></span>

  </button>

  <button class="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">

    <span class="carousel-control-next-icon"></span>

  </button>

</div>

</body>

</html>

--------------------------

Bootstrap Forms

-----------------------

<!DOCTYPE html>

<html lang="en">

<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet">

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>

</head>

<body>


<div class="container mt-3">

  <h2>Login form</h2>

  <form action="/action_page.php">

    <div class="mb-3 mt-3">

      <label for="email">Email:</label>

      <input type="email" class="form-control" id="email" placeholder="Enter email" name="email">

    </div>

    <div class="mb-3">

      <label for="pwd">Password:</label>

      <input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pswd">

    </div>

    <div class="form-check mb-3">

      <label class="form-check-label">

        <input class="form-check-input" type="checkbox" name="remember"> Remember me

      </label>

    </div>

    <button type="submit" class="btn btn-primary">Submit</button>

  </form>

</div>


</body>

</html>

-------------------------


Friday, 24 July 2026

Tally Price list and POS with GST

 

Price List Sum


ItemsWhole sellerDealerReseller
ChuditharRsDiscount (%)RsDiscount (%)Rs
00-51350-380-400
51-1013402%365-400
101 above3255%34010%400
Cotton sarees
00-51300-340-370
51-1012855%310-370
101 above2708%2905%370
Jeans
00-51380-420-450
51-1013605%400-450
101 above34510%3805%450
Sarees
00-51360-390-400
51-1013456%370-400
101 above3208%3508%400
1. Apr 2 Goods sold to M/s. Jayappa Readymade (Whole seller) for the following
  • Cotton sarees 150nos (5% GST)
  • Sarees 550nos (5% GST)
  • Jeans 400nos (5% GST)
2. Jun 5 Goods sold to Mr. Nalli Readymade (Dealer) for the followings
  • Jeans 50nos, 100nos, 150nos (5% GST)
  • Cotton sarees 50nos, 100nos, 150nos (5% GST)
  • Chudithar 50nos, 100nos, 150nos (5% GST)
  • Sarees 50nos, 100nos, 150nos (5% GST)

Tally GST Practice










Thursday, 23 July 2026

Tally Practical

 Practical Sum: 1 

1. Received capital(Anu) Amount Rs.100000(50000+50000) 

2. Received capital(Aswini) Amount Rs.50000 

3. 1.1.2018 Deposit bank(CUB) - 5000(cash to bank) 

4. 2.1.2018 Deposit bank(CUB) - 5000(cash to bank) 

5. 1.1.2018 Deposit bank(SBI) - 15000(cash to bank) 

6. 2.1.2018 Deposit bank(SBI) - 7500(cash to bank) 

7. 1-2-2018 Withdraw Amount from CUB(2000)(bank to cash) 

8. 2-2-2018 Withdraw Amount from CUB(1500)(bank to cash) 

9. 1-2-2018 Withdraw Amount from SBI(1500)(bank to cash) 

10. CUB to SBI Rs.100(Fund transfer)(bank to bank) 

11. petty cash(cash in hand) amount Rs. 1000 

12. Cash Deposit into SBI bank Rs. 1,50,000  

13. Cash Withdraw from SBI bank Rs. 25,000   

14. Fund Transfer from SBI to CUB Rs.2000  

15. Jahab Deposit into SBI bank Rs. 55,000 by cash 

16. Jasmine withdraw From SBI bank Rs. 5,000 by cash 

17. Fund Transfer from CUB (Jahab) to SBI (Jasmine) Account Rs.2000

18. Opened a SBI Bank Account with Rs.100000 

19. Received for Room Rent Rs. 9000. 

20. Received for Salary of Rs. 1500 

21. Received for Travelling Expenses Rs. 2000 

22. Received from "Krishna Mohan A/c" of Rs. 12000 

23. Received from "Mehatha G/s" of  Rs. 7500 by Cash  

24. Received from "Siva Mohan Agency" of  Rs. 25000 by cash 

25. Rs.500 Interest Received from SBI Bank  

26. Sold 10 Pcs of Pen drive @ 500/- to Jahab on cash Rs. 5000  

27. Commenced (started or capital or investment) business with cash Rs.10, 000. 

28.Received Capital by cash from Jahab Rs.30000 

Tally Practical (Contra, Payment, Receipt, Journal)

 

Tally Practical (Contra, Payment, Receipt, Journal)

Contra (F4):

 1. Cash Deposit into SBI bank Rs. 15,000 (Cr (or) To: Cash, Dr (or) By: SBI) 

2. Cash Withdraw from SBI bank Rs. 25,000 (Cr (or) To: SBI, Dr (or) By: Cash) 

3. Fund Transfer from SBI to CUB Rs.2000 (Cr (or) To: SBI, Dr (or) By: CUB) 

4. Jahab Deposit into SBI bank Rs. 55,000 by cash 

5. Jasmine withdraw From SBI bank Rs. 5,000 by cash 

6. Fund Transfer from CUB (Jahab) to SBI (Jasmine) Account Rs.2000 

7. Opened a SBI Bank Account with Rs.100000 

Payment (F5): 

1. Paid for Room Rent Rs. 9000 by cash/cheque (Dr (or) By: Room Rent, Cr (Or) To: cash)  

2. Paid for Stationary of Rs. 1500 by cash/cheque 

3. Paid for Travelling Expenses Rs. 2000 by cash/cheque 

4. Paid to "Jahab A/c" of Rs. 12000 by cash/cheque 

5. Paid To "Jasmine A/c (Sundry Creditors)" of Rs. 7500 and Cash Discount Rs. 250 

6. Paid to "Jahab Agency" of Rs. 25000 by SBI Bank 

7. Paid to Tea Expenses Rs.50 

8. Paid to Local Conveyance Rs.250 

9. Paid to Printing & Stationery Rs.450 

10. Paid to Telephone charges Rs.800 

11. Paid salary 10000 and office Rent 5000 by cash  (Dr (or) By: Salary, Office Rent Cr (Or) To: cash)  

12. Paid for building (Fixed Asset) Rs.10000 

13. Paid for Machines (Fixed Asset) by cheque Rs.50000 

14. Paid for Wages Rs.1000 

15. Paid for carriage Inwards Rs.500 

16 Paid to petty cash (Cash in hand) Rs.5000 

17. Paid for Postage & stamps Rs.500 

18. Paid by Petty cash for postage & Stamps Rs.1200 

19. Cash Withdraw from capital account Rs.500 for Personal use (Dr: Drawing, Cr: cash)

Receipt (F6) 

1. Received for Room Rent Rs. 9000. (Cr (or) To: Room Rent, Dr (Or) By: cash)  

2. Received for Salary of Rs. 1500 

3. Received for Travelling Expenses Rs. 2000 

4. Received to "Krishna Mohan A/c" of Rs. 12000 

5. Received To "Mehatha G/s" of  Rs. 7500 by Cash  

6. Received to "Siva Mohan Agency" of  Rs. 25000 by cash 

7. Rs.500 Interest Received from SBI Bank (Cr (or) To: InsReceived, Dr (Or) By: cash) 

8. Sold 10 Pcs of Pen drive @ 500/- to Jahab on cash Rs. 5000 (Cr: Sales  Dr: Cash)  

9. Commenced (started or capital or investment) business with cash Rs.10, 000. 

10.Received Capital by cash from Jahab Rs.30000 

Journal (F7) 

1. Depreciation charge on Furniture Rs.5000 by cash (By: Depreciation, To: Furniture)       

2. Depreciation charge on Machinery Rs.20000 by cash (By: Depreciation, To: Machinery) 

3. Depreciation charge on Furniture & Machinery Rs. 5000 and Rs.20000 respectively 

           (By: Depreciation, To: Machinery, To: Furniture) 

4. Jahab is an employee of ISS, his monthly salary is Rs.30000/-, he took some salary advance from company of 

Rs.10000/- on 08/03/2022. Here will see how to adjust salary advance against his Mar-2022 Salary. 

Note: i) Jahab salary A/c- Direct Expenses (Salary Group) 

         ii) Salary Payable A/c – Current Liabilities 

        iii) Salary Advance to Jahab – Current Assets 

        iv) CUB – Bank Accounts  

Step1: Make Payment (F5) 

           By: Salary Advance to Jahab      10000 (Dr) 

           To:  CUB Bank (Cr) 

Step2: Make Journal (F7) 

           By: Jahab Salary A/c      30000 (Dr) 

           To: Salary Advance to Jahab      10000 (Cr) 

           To:  Salary Payable                      20000 (Cr)

Thursday, 29 January 2026

Linux

 Software(s/w)

-----------

software - set of programs

Program - set of coding  or instruction or commands

Coding - How to execute our application(setp by step)



user real time problem-----------------------Systematic manner

                                        Software


Ex1:

    2+3--------------------------------systematic or device

               calculator


Ex2 : 

   Search---------------------Systematic or device

                 Browser(Opera,Google chrome...)

Ex3:

   chat------------------------Systemtic or device

            Whatsapp,fb


Types of software

-----------------------

1. Application Software(apps)

2. System Software


1. Application Software

-----------------------------

-can visible

-user interaction(directly work with the user)

-request and response

-Windows based(GUI(Graphical User Interface) based)

Ex:

    Word,Excel,Powerpoint,Paint,Photoshop,Player,Games,Calculator,Browser.....


2. System Software

------------------------

-System Programs(inbuild programs)

-cant visible

-backbone of application software


Ex:

   1) OS    2) Translator     3) Device Drivers   4) Firmware


1) OS(Operating System)

    ---------------

-OS is a System Software

-OS is a System Programs

-brain of the computer

-control of system

-like input and output management  (request and response)

-Memory Management

-File Management

-Resource Control management(USB,Keyboard,Mouse,Printer...)


User --------------- System software or Application software

            OS


Ex:   PC   : Windows(XP,7,8,10,11), Unix, Linux, Mac, DOS---DOS Prompt(CUI - Character User Interface)--C,C++,Java,C#

     Mobile : Android, IOS, Blackberry, Bada, Funtouch,Tizen,Colors---Smartphone OS

   Keypad : Symbian


2) Translator  

---------------

-Translator is a System Software

-Translator is a System Programs

-It converts source code to machine code


Source code--------------------------------Machine code

(user understand)   Translator              (binary code,(0,1),low level,object code,Target code)

(English)


Ex: Compiler, Interpreter, Assembler


Compiler

-------------

-Compiler is a translator

-Compiler is a System Software

-Compiler is a System Programs

-Error checking(check all lines)


Source code--------------------------------Machine code

(user understand)  Compiler              (binary code,(0,1),low level,object code,Target code)

(English)


Ex:

    st1;

    st2;   //error

    st3;

    st4;  //error

    st5;

 

       Compiler Result : error at 2 and 4


Interpreter

-------------

-Interpreter is a translator

-Interpreter is a System Software

-Interpreter is a System Programs

-convert line by line


Source code--------------------------------Machine code

(user understand)  Interpreter             (binary code,(0,1),low level,object code,Target code)

(English)


Ex:

    st1;

    st2;   //error

    st3;

    st4;  //error

    st5;

 

       Interpreter Result : error at 2


Assembler

--------------

-Assembler is a translator

-Assembler is a System Software

-Assembler is a System Programs


Assembly code --------------------------------Machine code

(user understand)    Assembler             (binary code,(0,1),low level,object code,Target code)

(English)

(Numonics) or Cryptic

(Microcontoller--Microchip)

Ex:

  ADD,SUB,PRINT

==================================

OS

---

-Operating System

-OS is a System software or system programs

-brain of the computer

-Control of system

  (input and output management)

  (Resource Management)-Keyboard...

  (Memory management)

  (File management)

Ex(PC): Windows,DOS,Unix,Linux,Max

Mobile: Android,IoS,Windows,Bada,Tizen,Blackberry,Colors,Symbian

  


Linux

-------

-Developed by : Linus Torvalds

-Year : 1991 sep(1.0)

-Written in : C and Assembler

-License : GNU & GPL(General Public License)

-Kernal Based OS(Monolithic  Space : Kernal Type) (.ko)


Features of Linux

---------------------

-Linux is a OS(Operating system)

-Linux is a OSS(Open Source Software- Free download, Free Use(free Lic), Source Code Available)

-Linux is a Multiuser(Share multiple User) & Multitask OS

-Linux is a NOS(Network Operating System)   

-Linux Shell based(program) & Desktop Based OS (GUI)

-OS is a System Software

-OS is a System Programs

-brain of the computer

-control of system

-like input and output management  (request and response)

-Memory Management

-File Management

-Resource Control management(USB,Keyboard,Mouse,Printer...)

===================================

Uses of Linux

----------------

-Cloud Computing

-Embedded Devices

-Mainframe Computers

-Mobile Devices

-Personal Computers

-Servers

-Super Computers

-Routers

-Automation Controls

-TV

-Digital Video Recorders

-Video Games Controller

-Smartwatches

-Tablets

-cars

-Refrigerators

-Laptops & Desktop PC

===============================

Apllications of Linux

-------------------------

-Dell inspiration mini

-Google Android

-HP mini

-Motorola motoRokr

-Sony Bravia TV

-Volvo car(Navigation System)

-Yamaha motit Keyboard

==============================

Linux Distribution(Distro) -- Linux Version ***

--------------------------

Desktop (GUI Based)--Window   --Execute Our application software

---------

-Fedora

-Linux Mint

-Debian

-SUSE Linux

-Ubuntu


Shell Based  --Execute our Programming

--------------

-RED Hat Linux

-Gentoo

-Canonical

-Slack ware  Linux

-Caldera Linux

-Mandrake Linux

-CentOS

-Mandriva

-ArchLinux

===================================

Linux Architecture

-----------------------

1. Hardware

2. Kernel

3. Shell

4. Applications


1. Hardware 

   -Physical components of computer

    Ex: Harddisc, RAM,ROM,Motherboard,Terminals


2. Kernel

   -extension : .ko 

   -locate : /lib/modules

   -Its is a OS

   -brain of the computer

   -system software or system programs

   -control of system

      (like input and output management

              Resource management, File,Memory) 

   -schedule management 


3. Shell

-Its is a CLI(Command Line Interface) or CUI(character User Interface)

-It is used to execute programs

-Variables,Arrays and fucntion,strings manipualtion

-Arithmetic and Logical calculations 


Different types of shell

----------------------------

1. Bourne Shell (.sh) - logical and arithmetic calculation

2. C shell (.csh) - Arithmetic and expression

3. TC Shell(.tcsh) - C Shell & Word Processing

4. Korn Shell (ksh) - Arithmetic, Functions, Arrays and strings

5. GNU Bourne (Again Shell)(.bash)- default linux shell


4. Applications

-Window or desktop application

-GUI format

-end user applications

-user interaction(request and response)

Ex:

   Player,Browser, Text Editors, Database

=================================

variable

-----------



Comment line

----------------

1. single line comment  -- one line decription or author name,program title

 #

2. Multiline comment -- paragraph format

'''

'''


#Program 1 : Display your name

echo "welcome to Linux" 


#Program 2 : Add two numbers

a=10

b=20

c=$(($a+$b))

echo "Result is : $c"


#Program 3 : Add two numbers

echo "Enter a :"

read a

echo "Enter b :"

read b

c=$(($a+$b))

echo "Result is : $c"


#Program 3 : Add two numbers

echo -n "Enter a :"

read a

echo -n "Enter b :"

read b

c=$(($a+$b))

echo "Result is : $c"



1. simple interest calc

2. volume of spehere

3. cone

4. cylinder

5. area of circle

6. area of triangle

=====================================================

Control structure

----------------------

-flow the control of execution

-chnage(skip or repeate) the order of execution


Types

-------

1. Conditional statement 

2. unconditional statement

3. looping statement



1. conditional statement

-------------------------------

1. if statement

    a. simple if

    b. simple if else

    c. elif ladder

    d. nested if

2. case..esac statement 


if statement

---------------

-To check the given conditon is true or false


Types

-------

1. simple if

2. simple if else

3. elif ladder

4. nested if


1. simple if

-------------

-To check the given condition is true

-prsent true part only


syntax:

---------

if  [ condition ]

then

   statement

fi


Working

----------

step1 : to check the given condition

step2: if the given condition is true than execute true part statement

           otherwise exit from if statement


#to check +ve

echo  "Enter the value of n :"

read n


if [ $n -gt 0 ]

then

    echo "The given no is +ve"

fi

-------------------------

2. simple if else

-------------

-To check the given condition is true or false

-prsent true part and false part


syntax:

---------

if  [ condition ]

then

   statement

else

   statement

fi


Working

----------

step1 : to check the given condition

step2: if the given condition is true than execute true part statement

           otherwise execute else part statement


#to check +ve or -ve

echo  "Enter the value of n :"

read n


if [ $n -gt 0 ]

then

    echo "The given no is +ve"

else

    echo "The given no is -ve"

fi

-------------------------

echo "enter the value of n"

read n

n1=$(($n%2))


if [ $n1 -eq 0 ]

then

   echo "The given no is even"

else

   echo "The given no is odd"

fi

-------------------------

3. elif ladder

----------------

-check more than one condition


syntax:

-------

if  [condition1]

then

elif [condition2] 

 then

   statement

elif [condition3] 

 then

   statement

else

  statement

fi


Working

----------

step1 : to check the given condition

step2: if the given condition is true than execute true part statement

step3: otherwise to check another elif condition

step4: suppose all condition are flase then execute else part statement


#ex

echo "enter the value of n"

read n


if [ $n -eq 1 ]

then

  echo "Good mor"

elif [ $n -eq 2 ]

then

  echo "Good noon"

elif [ $n -eq 3 ]

then

  echo "Good eve"

elif [ $n -eq 4 ]

then

  echo "Good nt"

else

  echo "Invalid input try again"

fi

-----------------

4. nested if

--------------

-one if contain another if


syntax:

---------

if [condition]

then

   statement

    if[condition]

    then

      statement

else

 statement

---------------

Working

----------

step1 : to check the given condition

step2: if the given condition is true than execute true part statement

step3: otherwise to check another if condition

step4: suppose all condition are flase then execute else part statement


#ex1

echo "enter the value of n"

read n


n1=$(($n%4))

n2=$(($n%400))


if [ $n1 -eq 0 ]

then

   if [ $n2 -eq 0 ]

   then

     echo "leap year"

   else

     echo "not leap"

   fi

else

  echo "not leap year"

fi

-----------------

4. case..esac statement

-------------------------------

-multiway branching statement

-choice based system

-single exp but more than one case value


syntax:

--------

case exp in

  pattern1) statement1;;

  pattern2) statement2;;

  pattern3) statement3;;

   ...

   *) statement;;

esac


working

------

step1 : to check the given condition and pattern

step2: if the given condition is true than execute pattern1 statement

step3: otherwise to check another pattern condition

step4: suppose all pattern are flase then execute else part(*) statement


#ex: case..esac

echo "Enter the value of n :"

read n

case $n in

1) echo "one";;

2) echo "two";;

3) echo "three";;

*) echo "invalid";;

esac

----------------------------------

Looping statement or repeativity or iteration

----------------------

-set of statement is repeated until condition is false


Types

-------

1. for

2. while

3. until   ------not support do while


1. for

------

-set of statement is repeated until condition s false

-entry controlled loop(first check the condition,next execute statement)


syntax1:

---------

 for var in{start..end}

 do

    statement

 done


syntax2:

---------

for((initilization;condition;increment or decrement))

do

  statement

done


working

----------

step1: initilized the given variable

step2: check the given conidition,if the condition is true than execute statement

           (suppose condition is false than exit from looping statement)

step3: next goto increment part


#ex1

for((i=1;i<5;i++))

do

  echo "welcome"

done


#ex2

for i in {1..5}

do

 echo "welcome"

done


2. while

---------

-set of statement is repeated until condition is false

-entry controlled loop(first check the condition,next execute statement)


syntax:

-------

while(condition)

do

  statement

done


working

----------

step1: initilized the given variable

step2: check the given conidition,if the condition is true than execute statement

           (suppose condition is false than exit from looping statement)

step3: next goto increment part


#while

i=1

while(($i < 5))

do

  echo "welcome"

  i=$(($i+1))

done


3. until

---------

-set of statement is repeated until condition is true


syntax:

--------

until(condition)

do

  statement

done


#Ex1

i=1

until(($i>5))

do

  echo "welcome"

  i=$(($i+1))

done

======================

break                                      

-----                                      

-break is a unconditional statement

-Exit from loop                     


syntax:

---------

for((initilization;condition;increment or decrement))

do

     if(condition)

     then

       break

     fi

done


Ex:

---

for i in {1..5}

do

   if [ $i = 3 ]

   then

    break

   fi

 echo "welcome"

done


continue

----------

-continue is a unconditional statement

-ignore(skip) current iteartion


syntax:

---------

for((initilization;condition;increment or decrement))

do

     if(condition)

     then

      continue

     fi

done


Ex:

---

for i in {1..5}

do

   if [ $i = 3 ]

   then

     continue

   fi

 echo "welcome"

done

=====================================================

Assignment Topics 

----------------------

1). Linux features,Uses,Applications & Linux Distrbutions(Distro)

2). Linux Architecture

3). Define Variable and Types of variable(Shell Variable & Environment Variable(System variable)), 

     Rules for naming a variable

4). Conditional statements (or) branching Statement

  1. if statements

     a. simple if

     b. simple if else

     c. elif ladder

     d. Nested if

  2. case..esac statements

  3. Looping statements

    a. for loop

    b. while loop

    c. until loop

  4.difference between break and continue

-----------------------------

5). Explain Vi editor & Vi commands (mode of vi editor) & Different Access mode codes

6). Substitution Command, File Mask & Root in Linux

7). Linux files and directory commands 

8). Explain File listing commands & wc commands 

9). Explain Filter commands

10). Explain tee commands & Redirection commands & Pipes commands

11). Palindrome checking program

12). sum of the individual digits

13). factorial calculation program

----------------------

R Basics

 Module I:  R Introduction – R Advantages and Disadvantages – R Installation – RStudio IDE – R Basics – R Basic Syntax – R Data Types – R Va...