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

28th Jun 2020, 11:47 AM
Lucky Khobragade
Lucky Khobragade - avatar
38 ответов
+ 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
28th Jun 2020, 11:49 AM
Alexander Thiem
Alexander Thiem - avatar
+ 1
Hi there 👋 Please use this thread for programming queries only. Happy Coding https://www.sololearn.com/discuss/1316935/?ref=app
28th Jun 2020, 11:53 AM
Nilesh
Nilesh - avatar
+ 1
Hello Lucky Khobragade If this is your homework please show us your attempt.
28th Jun 2020, 12:01 PM
Denise Roßberg
Denise Roßberg - avatar
+ 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
28th Jun 2020, 12:04 PM
Nilesh
Nilesh - avatar
28th Jun 2020, 12:14 PM
Alexander Thiem
Alexander Thiem - avatar
+ 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
28th Jun 2020, 12:18 PM
Nilesh
Nilesh - avatar
+ 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.
28th Jun 2020, 12:22 PM
Denise Roßberg
Denise Roßberg - avatar
0
But I don't know n how to use that static void operators()
28th Jun 2020, 12:03 PM
Lucky Khobragade
Lucky Khobragade - avatar
0
I am solving that by traditional methods
28th Jun 2020, 12:03 PM
Lucky Khobragade
Lucky Khobragade - avatar
0
I know bt it not work
28th Jun 2020, 12:04 PM
Lucky Khobragade
Lucky Khobragade - avatar
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.
28th Jun 2020, 12:05 PM
Denise Roßberg
Denise Roßberg - avatar
0
I said that use static void operators (int a, int b) for arithmetic operations
28th Jun 2020, 12:05 PM
Lucky Khobragade
Lucky Khobragade - avatar
0
I don't know n that wait I give u ss
28th Jun 2020, 12:06 PM
Lucky Khobragade
Lucky Khobragade - avatar
0
Here we have to not use main method
28th Jun 2020, 12:10 PM
Lucky Khobragade
Lucky Khobragade - avatar
0
I have to also give the value to a and b how that's possible
28th Jun 2020, 12:11 PM
Lucky Khobragade
Lucky Khobragade - avatar
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.
28th Jun 2020, 12:14 PM
Denise Roßberg
Denise Roßberg - avatar
0
Ok bt I didn't find that's why I posted here
28th Jun 2020, 12:14 PM
Lucky Khobragade
Lucky Khobragade - avatar
0
Lucky Khobragade It is part of the basics. A tip: the learn section has also a search bar.
28th Jun 2020, 12:16 PM
Denise Roßberg
Denise Roßberg - avatar
0
Ok
28th Jun 2020, 12:16 PM
Lucky Khobragade
Lucky Khobragade - avatar
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....
28th Jun 2020, 12:17 PM
Alexander Thiem
Alexander Thiem - avatar