Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Illegal State of Expression Error
Akshit dhar
Greenhorn
Posts: 18
I like...
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why is the program showing illegal state of expression?
public class StrangeAdvertising { static int value= 2; public static void main(String... ar ){ Scanner sc= new Scanner(System.in); int limit = sc.nextInt(); int startDay =2; Finder(startDay,limit); } public static void Finder(int startDay,int lim) { while(startDay < = lim){ int val= (value*3)/2; value+=val; startDay++; } } }
Love the life you live.
Campbell Ritchie
Marshal
Posts: 79178
377
posted 7 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Please show us which line it is on. We can only help you if we know the full
details
.
I had to compile the code myself. Hint: operators should usually be surrounded by spaces, but must not contain intervening spaces.
Akshit dhar
Greenhorn
Posts: 18
I like...
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Campbell Ritchie. The space was giving the error.
Love the life you live.
Campbell Ritchie
Marshal
Posts: 79178
377
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
That's a pleasure
You appear to have posted the same thing twice, but I deleted it.
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how do i input
Commandline arg question
Compilation error (waiting for OP to provide better subject)
Armstrong Numbers. Program giving o as output all the time.
help on input character into screen
More...