View Full Version : Write a java program that reads an integer n from the key board and compute the value
other5
Jan 22, 2012, 03:08 PM
Write a java program that reads an integer n from the key board and compute the value of 2^n and output it to the screen
ScottGem
Jan 22, 2012, 03:12 PM
Thank you for asking our help with your homework assignment. However, there are some rules we have for doing so.
Do not simply retype or paste a question from your book or study material
We won't do your homework questions for you. You were given the assignment for you to learn.
If you come up with your own answer or process and post it for us to critique that is acceptable. If you have some SPECIFIC questions that you couldn't find or didn't understand, we may help with that.
But this is your assignment, so show us you have at least attempted to complete it on your own.
Thank you.
other5
Jan 22, 2012, 03:20 PM
public class interger
public static void main ( string [] args{
int value n=1
System.outprintin(" enter the value of the integer")
then I can't seem to finish it :(
ScottGem
Jan 22, 2012, 03:23 PM
I don't know Java, but you need to provide a way to input the value and assign it to a variable. From there it should be simple to compute the value of 2^n and output it.