0
Given two integers a and b, your task is to calculate :- a+b a-b a*b a/b Input User Task: Since this will be a functional prob
38 Answers
+ 3
To post a challenge for other users please dont ise QA! This is obly for Questions!
Like this:
https://www.sololearn.com/post/451756/?ref=app
+ 1
Hi there 👋
Please use this thread for programming queries only.
Happy Coding
https://www.sololearn.com/discuss/1316935/?ref=app
+ 1
Hello Lucky Khobragade
If this is your homework please show us your attempt.
+ 1
Lucky Khobragade
It's too easy
1. Assign two integral values to the variables a and b
2. For addition, take third variable eg - c, and add them
int c = a+b;
3. The same goes for division, multiplication and subtraction
+ 1
How to get user input:
https://www.sololearn.com/learn/Java/2220/
+ 1
Check this
void num(int a, int b)
int s = a+b;
S.O.Pln(s);
return s;
}
//add others here
psvm(String args[])
{
class ob = new class()
ob.new(5.10)
}
This is for addition
You you can easily do it for other operators using functions and
+ 1
Maybe you should give us your complete task. And I still don't know what you mean with static void operators.
You can have static members or static methods.
And the keyword void is only used for methods without return type.
Maybe you are confusing something.
0
But I don't know n how to use that static void operators()
0
I am solving that by traditional methods
0
I know bt it not work
0
What do you mean with static void oparators()?
static void means that your method belongs to the class and does not return a value.
0
I said that use static void operators (int a, int b) for arithmetic operations
0
I don't know n that wait I give u ss
0
Here we have to not use main method
0
I have to also give the value to a and b how that's possible
0
I think you should read the java course again.
int a = 3;
int b = 10;
Or use user input. You will find it in the java course.
0
Ok bt I didn't find that's why I posted here
0
Lucky Khobragade
It is part of the basics. A tip: the learn section has also a search bar.
0
Ok
0
I posted how to get user input and maths for Java and putput is explained in the course too, so if ypu still have a issue or question specify it....