1. write a program that will ask the user to enter a number n and display the number from 1 to n on single line?
2.write a program that will display the even number from 1 to 100?
3.given the value of n from the user, write a program that will display the first n even number. Ex. if n=5, then display the first 5 even integers which are 2,4,6,8,10?
4.write a program which accepts a number n and displays the sum of even numbers from 1 to n?
@stedav functions and methods are the same thing. Method is just the name that they receive talking about object oriented programming, but actually it is the same thing after all, it's like synonims.
Will someone, please, explain to a novice what it means when a function returns or doesn't return something? Return where? And what is the difference?
can you help me to solve this problem?
i really need to solve this. . . .
broken24able 3 months ago
5.write a program that will compute for n! which is the product of all number from 1 ton? then can you convert in function please. . . .tnx :-)
broken24able 3 months ago
can you help me for my java problem
1. write a program that will ask the user to enter a number n and display the number from 1 to n on single line?
2.write a program that will display the even number from 1 to 100?
3.given the value of n from the user, write a program that will display the first n even number. Ex. if n=5, then display the first 5 even integers which are 2,4,6,8,10?
4.write a program which accepts a number n and displays the sum of even numbers from 1 to n?
broken24able 3 months ago
not clear too advanced for a beginer
mukuruva 1 year ago 3
Just a point, in Java we use the term Methods for not functions, that's JavaScript!
stedav 1 year ago
yeah thats true its called methods
smutpolice007 1 year ago
@stedav functions and methods are the same thing. Method is just the name that they receive talking about object oriented programming, but actually it is the same thing after all, it's like synonims.
elchami743 1 year ago
Thank you very much.
kindevil1234 2 years ago
Comment removed
Matau8991 2 years ago
not very clear
piggg98765 2 years ago
Not bad, needs work but not bad
aveond2009 2 years ago
Public = On the "stage"
Private = Behind the "stage"
ajk321 2 years ago
hello, whats the software u r using for java?
drymlad 3 years ago
his using netbeans lool
keapergrave 2 years ago 2
"methods" in java; "functions" in C++, but whatever...
tdavies0 3 years ago
Will someone, please, explain to a novice what it means when a function returns or doesn't return something? Return where? And what is the difference?
Kasatka1984 3 years ago
When a function returns something you can used that returned value.
ie.
function add($v1, $v2) { return $v1 + $v2;
}
$myvalue = add(1, 2);
// now $myvalue = 3
If you never had a return value then it wont be possible to have $myvalue = 3
gorilla3d 3 years ago
Thank you for your reply. And your lessons are so helpful!
Kasatka1984 3 years ago
Very helpful
Thank you
JudeHider 4 years ago
certainly one of your worst there is no point in introducing these function things if you dont explain it all.
Nojtb 4 years ago
Thanks Justin.
Sailtherapy 4 years ago