import java.util.*;
class function
{
public static double gen(double i1,double i2,char c1)
{
double i3=0;
switch(c1)
{
case ‘+’:i3=i1+i2;break;
case ‘-‘:i3=i1-i2;break;
case ‘*’:i3=i1*i2;break;
case ‘/’:i3=i1/i2;break;
case ‘%’:i3=i1%i2;break;
}
return i3;
}
public static void main()
{
Scanner in=new Scanner(System.in);
System.out.println(“Enter two numbers and any\nopertaor \n+\n-\n*\n/\n%”);
double i1=in.nextDouble();
double i2=in.nextDouble();
in.nextLine();
char c=(in.nextLine()).charAt(0);
double call=gen(i1,i2,c);
System.out.println(“Result is = “+call);
}
}
Making money as a coder in 2025 is not much of a big or tough…
Lloyds Technology Centre, A tech and data company located in Hyderabad, India. They are part of…
How to Increase Height at Any Age Rise Above: How to Increase Height at Any…
In the fast-paced digital world, we often forget the timeless beauty that nature offers. Today,…
Top 10 Deadliest Kicks in Martial Arts: Master the Art of Knockouts Martial arts is…
How to Optimize Battery Life of Your Smartphone: Tips and Tricks for Prolonging Battery Health…