Generate Arithmetic exception in java

Write a program to generate Arithmetic exception in java.

package Exception_demo;

import java.util.*;
public class exception_1 
    public static void main(String args[])
        int a,b,c=0;
        Scanner s=new Scanner(;
        System.out.println("enter the value of a:");
        System.out.println("enter the value of b:");
        System.out.println("value of c is:"+c);
        System.out.println("bhavesh jain");

Leave a Reply

Your email address will not be published. Required fields are marked *