Java Program Example: Add Two Numbers From a User #13

preview_player
Показать описание

This Java program will take two numbers from a user and add them together! ✅ Java program examples like this should make it easier for you to learn java.

The plus sign in programming can be tricky... It acts differently with numbers and strings, but you'll surely get the hang of it! They aren't too bad :) If you followed along, congrats! You learned-by-doing!

I hope you enjoyed this tutorial on how to make a java program to add two numbers taking input from user! I like to have a nice mix of tutorials and actual projects for you all :)

Was this java program helpful to you?

Disclosure: The Springboard link provided is linked to my affiliate account & supports the channel.

~

Alex Lee
Комментарии
Автор

I learned 99% from this awesome tutorial than from my teacher

teamix
Автор

Thank you so much. I am totally a java beginner. Your step-by-step coding with explanation makes it much easier to understand the logic behind the code. Love & Peace :)

ivanchan
Автор

Nice! Your tutorials are well made and simple.

Maybe you can combine all your tutorials from 2018 and make one huge tutorial for 2019.

Why does this channel only have 344 subs?
I swear a channel like this should have way more.

Preposter
Автор

Thank you so much. Your tutorial helped me so much in figuring out what I was supposed to fix on an assignment!

simmeronice
Автор

Hey Alex, thank you so much for your explanation your awesome! I’m watching your videos and getting help to do my assignments.

sofianoor
Автор

How do you get take both inputs jn the same line?
Example:
"Enter 2 numbers: " 3 4
7

CE-vdpx
Автор

Thank you for the simple and easy tutorial sir, Iloveyou

GupMotivation
Автор

thank u so much sir....ur video was amazing..now am a java beginner also...i need much more videos

VanajaPasupathi
Автор

thanks for saving me on my computing homework

aqua_whale
Автор

This is like 4 years later and I am about to make $100 for a challenge and this really helps me understand. Thanks so much!

jeremiahjones
Автор

Thanks for this video i hope to see more video

jeff
Автор

Omg!! I was shocked ur amazing it's make easier

princessangeladivina
Автор

Way better than how my teacher taught me, thank you so much <3

Razberrylol
Автор

thanks for such an informative video, it is really effective

bonolosebe
Автор

This video have been very useful for me. Thanks for video

deyanetsalmanov
Автор

Thank God found this😍 Thankyouu so much❤❤

angelicamariesullano
Автор

Bro youre awesome but can you teach this in bluej please please please😥😥

mitalichakrovarty
Автор

I made the same program except in System.out.println I put System.out.println("The sum of the numbers "+ a +" and "+ b +" is "+ a + b);
But when i ran the program and entered 2 numbers e.g. 3 and 5, it said The sum of the numbers 3 and 5 is 35... Why???

Here is the code of my program
Pls. check and tell me why this is happening

import java.util.Scanner;

public class Adding {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("Enter a number");
int a = scan.nextInt();

System.out.println("Enter another number");
int b = scan.nextInt();

System.out.println("The sum of the numbers "+ a +" and "+ b +" is "+ a + b);
}
}

polar
Автор

Great video, thanks for the new info 👍🏽

OhhAspireHD
Автор

anyone know how to get the print to be: 3 + 5 = 8, and not just the number, or "the sum is 8"?

iAtulu