Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within IDEs and Version Control
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:
Other IDEs, Version Control
Syntax error on token(s), misplaced construct(s)
Ali KiaKazemi
Greenhorn
Posts: 1
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi , can anyone find what s problem with this code ?
it says Syntax error on token(s), misplaced construct(s)
import java.util.Scanner; public class Fibonacci { public static void main (String[]args){ Scanner f = new Scanner(System.in); int n = f.nextInt(); int resault=0 ; int i; int t1 = 1; int t2 = 1; if (n==0){ resault = 0; }else if ( n==1 ){ resault = 1; }else if (n>1) { for (i=2 , i=n , i=i+1 ){ resault = t1 + t2 ; t1=t2; t2=resault; }; } System.out.println(resault); }
Sumit Patil
Ranch Hand
Posts: 296
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please
QuoteYourSources
Also,
ShowSomeEffort
and use code tags (
UseCodeTags
)
Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5,
LinkedIn Profile
Peter Johnson
author
Posts: 5856
7
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Wow, you really confused the compiler by using commas instead if semicolons in your for statement (line 17).
JBoss In Action
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Homework Trouble: Not understood syntax error, Instance of a generic BST class
Error in using JWIG
Linked List help
Syntax error on token "void", @ expected
Syntax error on token(s), misplaced construct(s)
More...