Wednesday, 24 December 2014

Rules for writing an algorithm

Qualities of a good algorithm

  1. Inputs and outputs should be defined precisely.
  2. Each steps in algorithm should be clear and unambiguous.
  3. Algorithm should be most effective among many different ways to solve a problem.
  4. An algorithm shouldn't have computer code. Instead, the algorithm should be written in such a way that, it can be used in similar programming languages.
Write an algorithm to add two numbers entered by user.
Step 1: Start
Step 2: Declare variables num1, num2 and sum. 
Step 3: Read values num1 and num2. 
Step 4: Add num1 and num2 and assign the result to sum.
        sumnum1+num2 
Step 5: Display sum 
Step 6: Stop
 

Rules for drawing a FLOWCHART

Terminator All flowcharts start and end with the terminator or terminal shape. This is a rounded rectangle and is shown below. You use this same shape for both the start and the end. You will see some charts with slightly different terminal shapes. For example, sometimes an oval is used. This is because there is no golden standard for flowcharting. Different companies and different technical areas use different shapes. There are a few basic rules and, beyond that, you can create your own rules for your organization. If you add your own shapes, it is important that you explain what they are used for, so others can understand your chart.
Just click on the terminator shape in the stencil and then type in the text.

 

To read a flowchart, you follow the arrows from shape to shape. To draw a line in RFFlow, click on the line in the stencil at the left and then drag the mouse to draw the line in your chart. It is faster to place all your shapes first and then draw all the lines at once.
 

Decision The decision shape asks a question. "Are you under 65 years of age?" If you are less than 65 years old, you follow the arrow going down out of the decision shape. If you are 65 or older, you follow the arrow to the right.
Process The rectangle is used for activities or action steps. These are things that must be done.
 
Circle A circle containing a letter or number means that this chart connects to another chart on a different page. The same circle and number are then the entry point on the new page. It is best not to use these, but sometimes they are necessary.
Title It is good to have a title on your chart. Just click on the word "Text" in the stencil and use a larger font size.
Putting it all together The chart shown below could be part of the 2006 Federal Income Tax return instructions. You start at the top and follow the arrows from shape to shape. Flowcharts usually go from top to bottom or left to right, but you can do whatever you want. The circle with the letter B refers to a chart on a different page. You would find that page and look for a B in a circle. Almost all flowchart can be done with only these four shapes. 
Moving you chart into a document After drawing your chart, you can copy and paste the chart into Microsoft Word or any other Windows program. If you want to put the chart on the internet, you can save your chart as a PNG or HTML file.
Flowchart Key If you are working in a group, it is advantageous to label each chart with the name of the person or group who created it and the date of creation. It is a also a good idea to have a key which lists the shapes you use in a chart and what they mean. An example is shown below:
Level of Detail You or your group must decide the level of detail to use in drawing your chart. Usually it is best to start specifying only general steps and leaving the details for later. Whatever you do, the level of detail should be consistent throughout the chart. For example, if you are flowcharting editing a Microsoft Word document, you might have a rectangle with the words "Print Document." A detailed chart might split this rectangle into several rectangles that show each step of clicking on the Print button in Word, selecting the appropriate printer, etc. Make sure you are not wasting time by specifying at too detailed a level. With RFFlow you can make hyperlinks in shapes so that when you click on the shape, you jump to another chart that has the details for that shape. You can also save RFFlow charts as HTML and have links to other Web pages.


MA: (hello world alike) 64-bit

section .data:
    input:db'Parashar',10
    inputLen: equ $-input

section .text
    global _start
    _start:
   
    mov rax,1
    mov rdi,1
    mov rsi,input
    mov rdx,inputLen

    syscall

    mov rax,60                ; The system call for exit (sys_exit)
     mov rbx,0                ; Exit with return code of 0 (no error)
     syscall  

[apcoer@localhost ~]$ nasm -f elf64 parashar.asm
[apcoer@localhost ~]$ ld -o parashar parashar.o
[apcoer@localhost ~]$ ./parashar
Parashar

MA: hello world(32 bit)

section .data

    hello:db'Hello World',10
    hellolen:equ $-hello

section .text
    global _start
    _start:

    mov eax,4;
    mov ebx,1;
    mov ecx,hello
    mov edx,hellolen;

    int 80h

    mov     ebx,0               ;first syscall argument: exit code
       mov     eax,1               ;system call number (sys_exit)
        int     80h                ;call kernel


[apcoer@localhost ~]$ nasm -f elf64 hellwrld.asm
[apcoer@localhost ~]$ ld -o hellwrld hellwrld.o
[apcoer@localhost ~]$ ./hellwrld
Hello World

MA: addition of 2 numbers


section .data
    input:db 'enter the number',10   ;
  
    inputLen:  equ $-input           ;
                                  ;
    display:db 'entered number is:',10   ;
  
    displayLen:  equ $-display       ;

    addition:db 'addtion of number is',10;
    additionLen: equ $-addition;

                                  ;


section .bss
a resb 3  
b resb 3
r resb 3


section .text
    global _start

_start:
    mov rax,1         ;string:enter number
    mov rdi,1            ;file discriptor
    mov rsi,input        ;input
    mov rdx,inputLen     ;lenght of input
                         ;
    syscall              ; Call the kernel

  
    mov rax,0         ;input
    mov rdi,0            ;standard input
    mov rsi,a       ;
    mov rdx,2          ;read only first two number
                         ;
    syscall              ;Call the kernel........

         
    mov rax,1         ;string2
    mov rdi,1            ;
    mov rsi,input        ;
    mov rdx,inputLen     ;
                         ;
    syscall              ; Call the kernel

    mov rax,0         ;input2
    mov rdi,0            ;
    mov rsi,b        ;
    mov rdx,2     ;
                         ;
    syscall              ; Call the kernel.....

     

    XOR RAX,RAX ;addition of 2 numbers
    MOV AL,[a]
    sub al,30h
    MOV BL,[b]
    sub bl,30h
    ADD AL,BL
    ADD al,30h
    MOV [r],AL
    syscall

    mov rax,1         ;string2
    mov rdi,1            ;
    mov rsi,addition      ;
    mov rdx,additionLen    ;
    syscall

    mov rax,1
    mov rdi,1
    mov rsi,r
    mov rdx,3


    syscall   
    mov rax,60                ; The system call for exit (sys_exit)
    mov rbx,0                ; Exit with return code of 0 (no error)
    syscall            ;


[apcoer@localhost ~]$ nasm -f elf64 add.asm
[apcoer@localhost ~]$ ld -o add add.o
[apcoer@localhost ~]$ ./add
enter the number
1
enter the number
2
addtion of number is
3

Wednesday, 19 November 2014

OSA: Lower case to upper case conversion and vice-versa

while(true)
do

echo " MENU
______________________________________________________________________________
1)Create a file and write into it
2)Convert Lower to Upper case
3)Convert Upper to Lower case
4)open file
5)Exit"

read choice
case $choice in

1) echo " Create and Write
------------------------------------------------------------------------------
Enter the name of file to be created ->"
read filename
if [ -f $filename ];
then
echo "filename $filename already exists,please try another filename"
else
touch $filename
chmod 777 $filename
# echo "Enter the data to be written into the file ->"
# read data
# cat>$filename
fi
;;

2) echo " Convert from Lower to Upper
------------------------------------------------------------------------------
Loading and translating Existing file :- $filename "
tr '[a-z]' '[A-Z]' <$filename
;;

3) echo " Convert from Upper to Lower
------------------------------------------------------------------------------
Loading and translating Existing file :- $filename "
tr '[A-Z]' '[a-z]' <$filename
;;

4) more $filename
;;

5) echo "Program will be terminated...."
exit 0
;;

esac
done

#tnx for using code from http://www.parazhar.blogspot.in

OSA: Display O.S. name,login name,host-name

while(true)
do

echo " MENU
------------------------------------------------------------------------------
1)Print O.S. name
2)Dispaly login name
3)Display host name
4)Exit
Please enter your choice -> "

read choice
case $choice in

1) echo "OS name -> "
uname
   echo "OS version -> "
cat /proc/version
;;

2) echo "Login name -> "
whoami
;;

3) echo "Host name -> "
hostname
;;

4) echo "program will be terminated "
exit 0
;;

esac
done

OSA: Process mangement

while(true)
do
echo " MENU
------------------------------------------------------------------------------
1)Display current shell
2)Display information of processes
3)Display global priority of processes
4)Change a priority of a process
5)Exit
Enter your choice -> "

read choice
case $choice in

1) echo " displaying current shell
------------------------------------------------------------------------------
"
ps
;;

2) echo " Information of processes
------------------------------------------------------------------------------
"
ps -al
;;

3) echo " Display global priority of processes
------------------------------------------------------------------------------
"
ps -ecl
;;

4) echo " Change priority
------------------------------------------------------------------------------
"
ps -ecl
echo "Enter process ID"
read PID
echo "Enter new priority value for the process"
read priority
renice $PID $priority
echo "Priority has been changed"
;;

5) echo "Program willl be terminated
-----------------------------------------------------------------------------
"
exit 0
;;

esac
done

#tnx for using code from http://www.parazhar.blogspot.in

OSA: Directory- create,delete,display PWD and change directory

while(true)
do
echo " MENU
------------------------------------------------------------------------------
1)Make a new directory
2)Delete a directory
3)Display current working directory
4)Change directory"

read choice
case $choice in

1) echo " New directory
==============================================================================
Enter name of directory to be created ->"
read name
if [ -d $name ];
then
echo "directory already exists, please try another name"
else
mkdir $name
echo "directory has been created successfully"
fi
;;

2) ls
echo " Delete directory
==============================================================================
Enter the name of directory to be deleted ->"
read dname
if [ -d $dname ];
then
rmdir $dname
echo "directory has been deleted  "
else
echo "invalid name, please try a valid directory name"
fi
;;

3) echo " Present working directory
-----------------------------------------------------------------------------"
pwd
;;

4) echo " change directory
-----------------------------------------------------------------------------
Enter the new directory path ->"
read path
cd $path
echo "directory has been changed"
;;

5) echo "Program terminated"
exit 0
;;

esac
done

#tnx for using code from http://www.parazhar.blogspot.in


OSA: User- add,delete,change access permissions for a file

while(true)
do

echo " MENU
------------------------------------------------------------------------------
1)Super User
2)Add user
3)Delete user
4)Change access permissions
5)Exit"

read choice
case $choice in

1) echo "act as super user inorder to add user
=============================================================================="
su
sh 3.sh s

;;

2) echo " add user
==============================================================================
Enter the User name -> "
read name
useradd $name
echo "User added successfully"
;;

3) echo " Delete user
==============================================================================
Enter the name of user to be deleted -> "
read username
userdel
userdel $username
echo "the user has been deleted"
;;

4) echo " change access permissions
==============================================================================
Enter the name of file ->"
read nfile
echo "Enter the access permissions for owner"
read owner
echo "Enter access permissions for group"
read group
echo "Enter access permisiions for user"
read other
chmod $owner$group$other $nfile
echo "Permissions changed"
;;

5) echo "Program terminated"
exit 0
;;

esac
done

OSA: File management (Create,rename,delete and list the file's in present working directory)

while(true)
do

echo  " Enter operation you want to perform
------------------------------------------------------------------------------
1)Create a File
2)Rename a File
3)Delete a File
4)List File's "
echo "enter your choice->"

read choice
case $choice in

1) echo "Enter the name of file to be created"
read filename
if [ -f $filename ];
then
echo "file already exists,please try another name"
else
touch $filename
echo "file has been created successfully"
fi #
;;

2) echo "Enter the name of File to be renamed "
read oldfilename
if [ -f $oldfilename ];
then
echo "enter the new file name to be assigned "
read newfilename
mv $oldfilename $newfilename
else
echo "file doesn't exist please try an existing filename"
ls
fi #
;;


3) echo "Enter name of File to be deleted "
read name
if [ -f $name ];
then
rm -f $name
echo "file has been deleted successfully"
else
echo "No such file ,please try again here are the contents of the directory:"
ls
fi #
;;

4) echo "list of file's in present working directory"
ls
#
;;


5) exit
echo "program terminated"
exit0
;;

esac #
done



Monday, 17 November 2014

Exam Edition ;)


Life is so tied up, everyday i open my eye's up to wake up to a busy day-the more tired i grow of life.
These exams' and academinc'S never seem to end , they just go on till infinity. Beside's this we all know that we'll be judged by the scores on that so called PEICE OF PAPER (degree).
As I'm done with theory paper's i wont be sayin' that it's over instead i'll call it....................

Friday, 19 September 2014

This is exactly what i was expecting!!



!hope i don't get this kinda output during EXTERNALS!

OSA: [Grp C-1] CPU MANUFACTURER INFO

while(true)
do
echo "CPU INFORMATION
      1.CPU CORES AND THREADS
      2.CPU MANUFACTURER
      3.EXIT"
read a;
case $a in
1)echo "CPU INFORMATION.."
dmidecode -t processor
;;
2)echo "CPU MANUFACTURER.."
dmidecode -s processor-manufacturer   
;;







3)echo "stopped...."
  exit 0
;;
esac;
done

OSA:[Grp B-15] CONVERT FILE INFO INTO LOWER/UPPER CASE

while true

do

echo "1.Create files :";
echo "2.To Upper :";
echo "3.To Lower";
echo "4.Exit";

echo "Enter your choice : ";

read ch;
case $ch in
1)

echo "Please enter File1 name : ";
read dirr;
touch $dirr.txt
chmod 777 $dirr.txt


echo "Open and write into $dirr.txt file manually"

;;
2)
echo "Upper Case is: ";
tr '[a-z]' '[A-Z]' < $dirr.txt
#tr '[:lower:]' '[:upper:]' < $dirr.txt



;;
3)
echo "Lower Case is: ";
tr '[A-Z]' '[a-z]' < $dirr.txt
#tr '[:upper:]' '[:lower:]' < $dirr.txt

;;

4)
exit 0;
;;
esac
done
#OUTPUT
[root@localhost apcoer]# sh upper.sh
1.Create files :
2.To Upper :
3.To Lower
4.Exit
Enter your choice :
1
Please enter File1 name :
roro
Open and write into roro.txt file manually
1.Create files :
2.To Upper :
3.To Lower
4.Exit
Enter your choice :
2
Upper Case is:
ROHIT MORE
COMPUTER ENGINEERING
1.Create files :
2.To Upper :
3.To Lower
4.Exit
Enter your choice :
3
Lower Case is:
rohit more
computer engineering
1.Create files :
2.To Upper :
3.To Lower
4.Exit
Enter your choice :
4
[root@localhost apcoer]#

OSA:[GRP A-5] PROCESS INFO

while (true)
do
echo "enter your choice
    1.current shell
    2. process information
    3.global priority
    4.change priority of process
    5. exit";
read a;
case $a in
1)echo"current shell";
read b;
ps b;
;;
2)echo" process information";
read c;
ps -f $c;
;;
3)echo"global priority";
read d;
ps -ao tty nice $d;
;;
4)echo"change priority of process";
read e;
ps -f $e;
echo"which want to change priority of process";
read f;
echo"enter parent id";
read g;
renice $f$g;
;;
5)exit 0
;;
esac;
done

OSA: ADD & DELETE USER

while (true)
do
echo "enter your choice
     1. add user
     2. delete user
     3.exit";
read a;
case $a in
    1) echo"enter user name to be add:";
 read c;
 useradd $c;
;;
   2)echo"enter user name to be delete:";
 read b;
 userdel $b;
 echo"device delete successfully";
read d;
;;
  3)exit 0
;;
esac;
done

OSA: MOUNT & UNMOUNT

while(true)
do

echo    "  MENU
------------------------------------------------------------------------------
        1)Display mounted devices
2)Mount a device
3)Unmount a device
4)See physical name and instance number
5)Exit"

read choice
case $choice in

1) echo "Mounted devices are -> "
mount
;;

2) echo " MOUNT
-------------------------------------------------------------------------------
Enter the name of device -> "
read name
   echo "Enter the mount point -> "
read point
mount $name $point
echo "the device has been mounted successfully"
;;

3) echo " Unmount
-------------------------------------------------------------------------------
enter source of device ->"
read devsource
umount -f  $devsource
echo "the device has been unmounted successfully"
;;

4) echo " Physical name and instance number
-------------------------------------------------------------------------------
"
dmesg
;;

5) echo "Program has been terminated"
exit 0
;;

esac
done

Thursday, 11 September 2014

Finally 1k PAGEVIEWS

Thank YOU guys for your support.
I would like to Thank my partner HAMMERSTIEN for uploading his unique programs!

Saturday, 30 August 2014

GENERAL:String

//============================================================================
// Name        : pi.cpp
// Author      : Rohit More
//============================================================================

#include <iostream>
#include <string.h>
using namespace std;

int main()
{

    char * string2="C++ Programming With Parazhar";

    int n = strlen(string2);
    for(int i=1;i<n;i++)
    {
        cout.write(string2,i);
        cout<<"\n";
    }
    for(int i=n;i>n;i++)
    {
        cout.write(string2,i);
        cout<<"\n";
    }
    cout.write(string2,n);
    cout<<"\n";


    return 0;
}
/*
 * OUTPUT
 C
C+
C++
C++
C++ P
C++ Pr
C++ Pro
C++ Prog
C++ Progr
C++ Progra
C++ Program
C++ Programm
C++ Programmi
C++ Programmin
C++ Programming
C++ Programming
C++ Programming W
C++ Programming Wi
C++ Programming Wit
C++ Programming With
C++ Programming With
C++ Programming With P
C++ Programming With Pa
C++ Programming With Par
C++ Programming With Para
C++ Programming With Paraz
C++ Programming With Parazh
C++ Programming With Parazha
C++ Programming With Parazhar

 */

GENERAL:Value of PI

//============================================================================
// Name        : pi.cpp
// Author      : Rohit More
//============================================================================

#include <iostream>
using namespace std;

int main()
{
    float pi=22.0/7.0;
    int i;
    cout<<"Val of pi:";

    for(i=1;i<20;i++)
    {
        cout.width(i+1);
        cout.precision(i);
        cout<<pi<<"\n";
    }
    return 0;
}
/*
 * OUTPUT
 * Val of pi: 3
3.1
3.14
3.143
3.1429
3.14286
3.142857
3.1428571
3.14285707
3.142857075
3.1428570747
3.14285707474
3.142857074738
3.1428570747375
3.14285707473755
3.142857074737549
3.1428570747375488
3.14285707473754883
3.142857074737548828
 *
 */

Monday, 25 August 2014

DSPS: paper boy (dfs traversal_graph)

//============================================================================
// Name        : newpaper_boy.cpp
// Author      : Parashar
// Version     :
// Copyright   : Do not try this at home
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
#define True 1
#define False 0
#define size 10

class graph
{
public:
    int n,e;
    int g[size][size],q[size];
    int front,rear;
    int visit[size];
int dist;
public:
    graph();
    void create();
    void dfs(int);
    void visited();

};

graph::graph()
{
    front=rear=-1;
    for(int v1=0;v1<size;v1++)
    {
        for(int v2=0;v2<size;v2++)
        {
            g[v1][v2]=g[v2][v1]=False;
        }
    }
}
    void graph::visited()
{
    for(int i=0;i<size;i++)
        visit[i]=False;

    dist=0;
}


void graph::create()
{
    int v1,v2,dist;
    cout<<"\nEnter the number of lanes:";
    cin>>n;
    cout<<"\nEnter Total number of paths leading to lanes:";
    cin>>e;

    for(int i=0;i<e;i++)
      {
        cout<<"\nEnter the lane a and b:";
        cin>>v1>>v2;
        cout<<"\nEnter the distance between the lane's entered: ";
        cin>>dist;
        g[v1][v2]=g[v2][v1]=dist;
      }


    cout<<"\n The Entered Graph is  "<<endl;
    for(int v1=0;v1<n;v1++)
        {
        cout<<"| ";
            for(int v2=0;v2<n;v2++)
            {
                cout<<g[v1][v2]<<"  ";
            }
            cout<<"|";
        cout<<endl;
        }
}

void graph::dfs(int v1)
{
    int v2;
    visit[v1]=True;
 cout<<v1<<" ";
 for(v2=0;v2<n;v2++)
 {
     if(g[v1][v2]!=false && visit[v2]==false)
     {
         dist=dist+g[v1][v2];
         dfs(v2);
     }
 }
}


int main()
{
     graph obj;
      int lane=0;
      int path,small=999;
      obj.create();
      cout<<endl<<"The newspaper boy has following paths to distribute newspaper : "<<endl;
      while(lane<obj.n)
       {
        obj.visited();
        cout<<"The way from lane "<<lane<<" is ";
        obj.dfs(lane);
        cout<<" And  the total path length "<<obj.dist;
        cout<<endl;
        if(obj.dist<small)
         {
          small=obj.dist;
          path=lane;
         }
       lane++;
      }

      cout<<endl<<"The Newspaper boy should start distributing newspaper from lane "<<path;
      cout<<"  which has least distance of "<<small;
      return 0;
}

DELD: 8:1 mux (IC 74151)

http://ecelab.xigega.com/pin-outs/74151.jpg 


Earthquake

reference-wikipedia

The following table lists the approximate energy equivalents in terms of TNT explosive force – though note that the earthquake energy is released underground rather than overground.[19] Most energy from an earthquake is not transmitted to and through the surface; instead, it dissipates into the crust and other subsurface structures. In contrast, a small atomic bomb blast (see nuclear weapon yield) will not, it will simply cause light shaking of indoor items, since its energy is released above ground.
31.6227 to the power of 0 equals 1, 31.6227 to the power of 1 equals 31.6227 and 31.6227 to the power of 2 equals 1000. Therefore, an 8.0 on the Richter scale releases 31.6227 times more energy than a 7.0 and a 9.0 on the Richter scale releases 1000 times more energy than a 7.0. Thus, E \approx 6.3\times 10^4\times 10^{3M/2}\,
Approximate Magnitude Approximate TNT for
Seismic Energy Yield
Joule equivalent Example
-0.2 7.5 g 31.5 kJ Energy released by lighting 30 typical matches
0.0 15 g 63 kJ
0.2 30 g 130 kJ Large hand grenade
0.5 85 g 360 kJ
1.0 480 g 2.0 MJ
1.2 1.1 kg 4.9 MJ Single stick of dynamite [DynoMax Pro]
1.4 2.2 kg 9.8 MJ Seismic impact of typical small construction blast
1.5 2.7 kg 11 MJ
2.0 15 kg 63 MJ
2.1 21 kg 89 MJ West fertilizer plant explosion[20]
2.5 85 kg 360 MJ
3.0 480 kg 2.0 GJ Oklahoma City bombing, 1995
3.5 2.7 metric tons 11 GJ PEPCON fuel plant explosion, Henderson, Nevada, 1988 Dallas, Texas earthquake, September 30, 2012
3.87 9.5 metric tons 40 GJ Explosion at Chernobyl nuclear power plant, 1986
3.91 11 metric tons 46 GJ Massive Ordnance Air Blast bomb St. Patrick's Day earthquake, Auckland, New Zealand, 2013 [21][22]
4.0 15 metric tons 63 GJ Johannesburg/South Africa, November 18, 2013
4.3 43 metric tons 180 GJ Kent Earthquake (Britain), 2007 Eastern Kentucky earthquake, November 2012
5.0 480 metric tons 2.0 TJ Lincolnshire earthquake (UK), 2008
M_\text{w} Ontario-Quebec earthquake (Canada), 2010[23][24]
5.5 2.7 kilotons 11 TJ Little Skull Mtn. earthquake (Nevada, USA), 1992
M_\text{w} Alum Rock earthquake (California), 2007
M_\text{w} Chino Hills earthquake (Southern California), 2008
5.6 3.8 kilotons 16 TJ Newcastle, Australia, 1989
Oklahoma, 2011
Pernik, Bulgaria, 2012
6.0 15 kilotons 63 TJ Double Spring Flat earthquake (Nevada, USA), 1994 Approximate magnitude of Virginia/Washington, D.C./East Coast earthquake, 2011
Approximate yield of the Little Boy Atomic Bomb dropped on Hiroshima (~16 kt)
South Napa Earthquake, 2014
6.3 43 kilotons 180 TJ M_\text{w} Rhodes earthquake (Greece), 2008
Jericho earthquake (British Palestine), 1927
Christchurch earthquake (New Zealand), 2011
6.4 60 kilotons 250 TJ Kaohsiung earthquake (Taiwan), 2010 Vancouver earthquake (Canada), 2011
6.5 85 kilotons 360 TJ M_\text{s} Caracas earthquake (Venezuela), 1967
Irpinia earthquake (Italy), 1980
M_\text{w} Eureka earthquake (California, USA), 2010
Zumpango del Rio earthquake (Guerrero, Mexico), 2011[25]
6.6 120 kilotons 500 TJ M_\text{w} San Fernando earthquake (California, USA), 1971
6.7 170 kilotons 710 TJ M_\text{w} Northridge earthquake (California, USA), 1994
6.8 240 kilotons 1.0 PJ M_\text{w} Nisqually earthquake (Anderson Island, WA), 2001
M_\text{w} Great Hanshin earthquake (Kobe, Japan), 1995
Gisborne earthquake (Gisborne, NZ), 2007
6.9 340 kilotons 1.4 PJ M_\text{w} San Francisco Bay Area earthquake (California, USA), 1989
M_\text{w} Pichilemu earthquake (Chile), 2010
M_\text{w} Sikkim earthquake (Nepal-India Border), 2011
7.0 480 kilotons 2.0 PJ M_\text{w} Java earthquake (Indonesia), 2009
M_\text{w} Haiti earthquake, 2010
7.1 680 kilotons 2.8 PJ M_\text{w} Messina earthquake (Italy), 1908
M_\text{w} San Juan earthquake (Argentina), 1944
M_\text{w} Canterbury earthquake (New Zealand), 2010
7.2 950 kilotons 4.0 PJ Vrancea earthquake (Romania), 1977
M_\text{w} 1980 Azores Islands Earthquake
M_\text{w} Baja California earthquake (Mexico), 2010
7.5 2.7 megatons 11 PJ M_\text{w} Kashmir earthquake (Pakistan), 2005
M_\text{w} Antofagasta earthquake (Chile), 2007
7.6 3.8 megatons 16 PJ M_\text{w} Nicoya earthquake (Costa Rica), 2012
M_\text{w} Oaxaca earthquake (Mexico), 2012
M_\text{w} Gujarat earthquake (India), 2001
M_\text{w} İzmit earthquake (Turkey), 1999
M_\text{w} Jiji earthquake (Taiwan), 1999
7.7 5.4 megatons 22 PJ M_\text{w} Sumatra earthquake (Indonesia), 2010
M_\text{w} Haida Gwaii earthquake (Canada), 2012
7.8 7.6 megatons 32 PJ M_\text{w} Tangshan earthquake (China), 1976
M_\text{s} Hawke's Bay earthquake (New Zealand), 1931
M_\text{s} Luzon earthquake (Philippines), 1990
7.9 10-15 megatons 42-63 PJ Tunguska event
1802 Vrancea earthquake
M_\text{w} Great Kanto earthquake (Japan), 1923
8.0 15 megatons 63 PJ M_\text{s} Mino-Owari earthquake (Japan), 1891
San Juan earthquake (Argentina), 1894
San Francisco earthquake (California, USA), 1906
M_\text{s} Queen Charlotte Islands earthquake (B.C., Canada), 1949
M_\text{w} Chincha Alta earthquake (Peru), 2007
M_\text{s} Sichuan earthquake (China), 2008
Kangra earthquake, 1905
8.1 21 megatons 89 PJ México City earthquake (Mexico), 1985
Guam earthquake, August 8, 1993[26]
8.35 50 megatons 210 PJ Tsar Bomba - Largest thermonuclear weapon ever tested. Most of the energy was dissipated in the atmosphere. The seismic shock was estimated at 5.0-5.2[27]
8.5 85 megatons 360 PJ M_\text{w} Sumatra earthquake (Indonesia), 2007
8.6 120 megatons 500 PJ M_\text{w} Sumatra earthquake (Indonesia), 2012
8.7 170 megatons 710 PJ M_\text{w} Sumatra earthquake (Indonesia), 2005
8.75 200 megatons 840 PJ Krakatoa 1883
8.8 240 megatons 1.0 EJ M_\text{w} Chile earthquake, 2010,
9.0 480 megatons 2.0 EJ M_\text{w} Lisbon earthquake (Portugal), All Saints Day, 1755
M_\text{w} The Great Japan earthquake, March 2011
9.15 800 megatons 3.3 EJ Toba eruption 75,000 years ago; among the largest known volcanic events.[28]
9.2 950 megatons 4.0 EJ M_\text{w} Anchorage earthquake (Alaska, USA), 1964
M_\text{w} Sumatra-Andaman earthquake and tsunami (Indonesia), 2004
9.5 2.7 gigatons 11 EJ M_\text{w} Valdivia earthquake (Chile), 1960
13.00 100 teratons 420 ZJ Yucatán Peninsula impact (creating Chicxulub crater) 65 Ma ago (108 megatons; over 4x1029 ergs = 400 ZJ).[29][30][31][32][33]
22.88 or 32 310 yottatons 1.3×1039 J Approximate magnitude of the starquake on the magnetar SGR 1806-20, registered on December 27, 2004.[clarification needed]