Skip to main content

#logicalcoding Add two Numbers. Write a program to take input from the ...

Write a program to take a number from the user and add this number to return the values.

Step-by-step becomes a logical programmer. this series is very helping full for you. I am going to introduce how to write the logic for this application and program. You have to take the values from the user and add this number it is a simple program but how you do how many cases are satisfied in this logic it is matter.

If you want this logic to watch this video.


Hi Welcome to coding part:

   I am going to introduce how to do this question in java.

Code:

//Description Addtion two number number,take from user
import java.util.Scanner;
class Addition 
{

public static float add(int a,int b){
      //Logic for addition
  float c=a+b;
      return c;
}
public static void main(String[] args) 
{
int a,b;
//Write logic for take the input form user
Scanner sc=new Scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
System.out.println(add(a,b));
}
}


Output:

Enter the two Number like that:
  100
 300
400 output

Enter the two Number:

3000
5000

8000 Output like that you can write this code.

If you have any problem with this question than you can comment in this page I will give you replay.

If you want Assignment Question then:

    Assignment Question: click hear

If you want to becom a good logical programer than join my youtube channel 

  Er prince Kumar Ojha click hare






Comments

Popular posts from this blog

#Logic How to convert String Characters lower to upper and upper to low...

How to convert String Characters.  lower to upper and upper to lower How to Convert all the String character Upper and lower . If String character is lower than convert Upper If it is Upper than you have to convert a lower. I am going to introduce it is a very simple and easy way. String Conversion is very easy through the toUpperCase() and toLowerCase(); Method But I am going to do this Question without using the Inbuilt method in the class. You have to do this Only For logical coding Question. So, Finally, I am going to do this Question step-by-step if you want to watch videos than you can watch. In these videos, I discuss this question in a very simple and easy way. You have to take one class with the main method.                class Test{                 public static void main(){                    //your logic ...

Top 97 logical coding Question | for Freshers for getting a job in MNC Company | by er prince kumar

            Top 97 logical coding Question  for Freshers  If you do this you will become good logical programmers Write a Java program to perform input/output of all basic data types. Write a Java program to enter two numbers and find their sum. Write a Java program to enter two numbers and perform all arithmetic operations. Write a Java program to enter the length and breadth of a rectangle and find its perimeter. Write a Java program to enter the length and breadth of a rectangle and find its area. Write a Java program to enter the radius of a circle and find its diameter, circumference, and area. Write a Java program to enter the length in centimeter and convert it into meter and kilometer. Write a Java program to enter the temperature in Celsius and convert it into Fahrenheit. Write a Java program to enter the temperature in Fahrenheit and convert to Celsius Write a Java program to convert days into years, weeks and days....

Java objective question for written Test | Java written test objective question

                               Java objective question All the best important question ------------------------------------------------------------------------ 1. Answer: Illegal combination of final and abstract class 2. Answer: 4 3. Answer:    error: bad operand types for binary operator '=='                 System.out.println("Helo"+10==10); 4. Answer:   error: integer number too large                 System.out.println(08); Q5. ====  class Nit { public static void main(String[] args) { m1(2); } public static void m1(int i) { if (i >= 0) { m1(i - 1); } System.out.println(" " + i); }} output:  -1  0  1  2 ================================== Q.2 ------ ...