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
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
Post a Comment