Simple calculator program in java using NetBeans use code on description subtitles also dont miss it

Опубликовано: 29 Июль 2026
на канале: Amansmea
10
1

simple Java program
calculator program In java using netbeans
java program with subtitles
like share subscribe
comment......
how to write a simple calculator java program.....
how to install java JDK and NetBeans link
   • How to install java JDK and NetBeans in wi...  
how to run a java program without ide
   • How to run java without IDE using notepad ...  

DO YOU WANT VOICE JUST COMMENT ......

file one code:
dont copy and past below my discriptaion symbols not working so i will write there
you can chang that symbol......then only it will be exicute


import java.util.Scanner;
public class calcu1 {
public static void main(String[] args) {
int a,b,c,selection;
Scanner in = new Scanner(System.in);
System.out.println("Enter the value of a and b");
a=in.nextInt();
b=in.nextInt();
System.out.println("enter your selection\n 1.addition\n2.subraction\n3.multiplication\n4.dividion");
selection=in.nextInt();
while (selection greater than symbol here 4){
System.out.print("please enter the correct selection");
selection=in.nextInt();
}
calcu2 bharath=new calcu2();
if(selection==1)
{
c=bharath.add(a, b);
System.out.println("The ans is:"+c);
}
else if (selection==2)
{
c=bharath.sub(a, b);
System.out.println("The ans is:"+c);
}
else if (selection==3)
{
c=bharath.mul(a, b);
System.out.println("The ans is:"+c);

}
else if (selection==4)
{
c=bharath.div(a, b);
System.out.println("The ans is:"+c);
}
}
}
2 nd file code:
public class calcu2{
public int add(int x,int y)
{
int z;
z=x+y;
return z;
}
public int sub(int x,int y)
{
int z;
z=x-y;
return z;
}
public int mul(int x,int y)
{
int z;
z=x*y;
return z;
}
public int div(int x,int y)
{
int z;
z=x/y;
return z;
}
}

greater then simple not working on youtube discription so
so
file one code:
check the while loop
and inset the simple before 4.....

like share and subscribe..... friends