SlideShare a Scribd company logo
Hello. This program has to be done in Eclipse(Program used to write java code)
Write a program that prints the first 30 numbers in the Fibonacci sequence while omitting the
third number(it is replaced with an X)
Ex: 0,1,X,2,3,X,18.....
I have most of the code but, cannot figure out the part on how to delete every third number in the
sequence 1 import java.util.*; 2 public class Fibonaccii 3e 4 5 6 7 public static void main
(String[] args) i Scanner s= new Scanner (System.in); System. out.println ("Enter you desired
value of n: ") int n = s.nextInt(); for (int i = 0; |
Solution
import java.util.*;
public class Fibonacci{
public static int fibonacci(int n){
if (n==0){
return 0;
}
else if(n==1){
return 1;
}
else{
return fibonacci(n-1)+fibonacci(n-2);
}
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
for (int i=1; i<=n; i++){
if(i%3!=0){
System.out.print(fibonacci(i-1)+" ");
}
else{
System.out.print("X ");
}
}
}
}

More Related Content

Similar to Hello. This program has to be done in Eclipse(Program used to write .pdf

3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
AbhishekSingh757567
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
ADITYA BHARTI
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
Ankit Gupta
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
Logan Chien
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
KimVeeL
 
Modify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdfModify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdf
arihantplastictanksh
 
import java.util.; public class DecimalToBinary { public stat.pdf
import java.util.; public class DecimalToBinary { public stat.pdfimport java.util.; public class DecimalToBinary { public stat.pdf
import java.util.; public class DecimalToBinary { public stat.pdf
anithareadymade
 
C#.net
C#.netC#.net
C#.net
vnboghani
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
MaruMengesha
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
Upender Upr
 
Codeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdfCodeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdf
anupamfootwear
 
LAB1.docx
LAB1.docxLAB1.docx
LAB1.docx
Aditya Aggarwal
 
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdfC# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
ssuserc77a341
 

Similar to Hello. This program has to be done in Eclipse(Program used to write .pdf (13)

3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Modify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdfModify before asshignment so that we can check input errors, etc.. P.pdf
Modify before asshignment so that we can check input errors, etc.. P.pdf
 
import java.util.; public class DecimalToBinary { public stat.pdf
import java.util.; public class DecimalToBinary { public stat.pdfimport java.util.; public class DecimalToBinary { public stat.pdf
import java.util.; public class DecimalToBinary { public stat.pdf
 
C#.net
C#.netC#.net
C#.net
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Codeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdfCodeimport java.util.Random; import java.util.Scanner;public .pdf
Codeimport java.util.Random; import java.util.Scanner;public .pdf
 
LAB1.docx
LAB1.docxLAB1.docx
LAB1.docx
 
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdfC# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
 

More from archiesgallery

Is it possible to provide health care without rationing In 1948 eve.pdf
Is it possible to provide health care without rationing In 1948 eve.pdfIs it possible to provide health care without rationing In 1948 eve.pdf
Is it possible to provide health care without rationing In 1948 eve.pdf
archiesgallery
 
In what structure does meiosis occur in the bryophytesSolution.pdf
In what structure does meiosis occur in the bryophytesSolution.pdfIn what structure does meiosis occur in the bryophytesSolution.pdf
In what structure does meiosis occur in the bryophytesSolution.pdf
archiesgallery
 
How was it established that particular phenotypes are inherited as a.pdf
How was it established that particular phenotypes are inherited as a.pdfHow was it established that particular phenotypes are inherited as a.pdf
How was it established that particular phenotypes are inherited as a.pdf
archiesgallery
 
Given the following homogeneous ODE 2y + 12y + 68y = 0 with initial .pdf
Given the following homogeneous ODE  2y + 12y + 68y = 0 with initial .pdfGiven the following homogeneous ODE  2y + 12y + 68y = 0 with initial .pdf
Given the following homogeneous ODE 2y + 12y + 68y = 0 with initial .pdf
archiesgallery
 
For an artist to be considered an outsider, he or she must first be.pdf
For an artist to be considered an outsider, he or she must first be.pdfFor an artist to be considered an outsider, he or she must first be.pdf
For an artist to be considered an outsider, he or she must first be.pdf
archiesgallery
 
Find a article or news about Biological ScienceIdentify source (in.pdf
Find a article or news about Biological ScienceIdentify source (in.pdfFind a article or news about Biological ScienceIdentify source (in.pdf
Find a article or news about Biological ScienceIdentify source (in.pdf
archiesgallery
 
Discuss in detail the importance of either ageneral standardstan.pdf
Discuss in detail the importance of either ageneral standardstan.pdfDiscuss in detail the importance of either ageneral standardstan.pdf
Discuss in detail the importance of either ageneral standardstan.pdf
archiesgallery
 
Distinguish between a blastula, a blastomere, a blastopore, and a bla.pdf
Distinguish between a blastula, a blastomere, a blastopore, and a bla.pdfDistinguish between a blastula, a blastomere, a blastopore, and a bla.pdf
Distinguish between a blastula, a blastomere, a blastopore, and a bla.pdf
archiesgallery
 
Compare and contrast an information systems development project in a.pdf
Compare and contrast an information systems development project in a.pdfCompare and contrast an information systems development project in a.pdf
Compare and contrast an information systems development project in a.pdf
archiesgallery
 
can high level language can use an assembler.SolutionHigh-l.pdf
can high level language can use an assembler.SolutionHigh-l.pdfcan high level language can use an assembler.SolutionHigh-l.pdf
can high level language can use an assembler.SolutionHigh-l.pdf
archiesgallery
 
Briefly describe a mechanim of virus entry into the cells and give o.pdf
Briefly describe a mechanim of virus entry into the cells and give o.pdfBriefly describe a mechanim of virus entry into the cells and give o.pdf
Briefly describe a mechanim of virus entry into the cells and give o.pdf
archiesgallery
 
Why are traditional definitions of “interception” problematic when a.pdf
Why are traditional definitions of “interception” problematic when a.pdfWhy are traditional definitions of “interception” problematic when a.pdf
Why are traditional definitions of “interception” problematic when a.pdf
archiesgallery
 
why is it important for macromolecular cellular structures to be fle.pdf
why is it important for macromolecular cellular structures to be fle.pdfwhy is it important for macromolecular cellular structures to be fle.pdf
why is it important for macromolecular cellular structures to be fle.pdf
archiesgallery
 
Widgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdf
Widgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdfWidgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdf
Widgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdf
archiesgallery
 
Which of the following entities can be homozygous (there may be mor.pdf
Which of the following entities can be homozygous (there may be mor.pdfWhich of the following entities can be homozygous (there may be mor.pdf
Which of the following entities can be homozygous (there may be mor.pdf
archiesgallery
 
Where is the lysosomes locales in the cell Where is the lysosom.pdf
Where is the lysosomes locales in the cell Where is the lysosom.pdfWhere is the lysosomes locales in the cell Where is the lysosom.pdf
Where is the lysosomes locales in the cell Where is the lysosom.pdf
archiesgallery
 
Which of the following is the most specific of security documents.pdf
Which of the following is the most specific of security documents.pdfWhich of the following is the most specific of security documents.pdf
Which of the following is the most specific of security documents.pdf
archiesgallery
 
What is the consequence when a chromosome loses its telomeresSol.pdf
What is the consequence when a chromosome loses its telomeresSol.pdfWhat is the consequence when a chromosome loses its telomeresSol.pdf
What is the consequence when a chromosome loses its telomeresSol.pdf
archiesgallery
 
We usually use when having a conversation with others. left hemisph.pdf
We usually use  when having a conversation with others.  left hemisph.pdfWe usually use  when having a conversation with others.  left hemisph.pdf
We usually use when having a conversation with others. left hemisph.pdf
archiesgallery
 
The security kernel is found at what protection ring levelA. Ring.pdf
The security kernel is found at what protection ring levelA. Ring.pdfThe security kernel is found at what protection ring levelA. Ring.pdf
The security kernel is found at what protection ring levelA. Ring.pdf
archiesgallery
 

More from archiesgallery (20)

Is it possible to provide health care without rationing In 1948 eve.pdf
Is it possible to provide health care without rationing In 1948 eve.pdfIs it possible to provide health care without rationing In 1948 eve.pdf
Is it possible to provide health care without rationing In 1948 eve.pdf
 
In what structure does meiosis occur in the bryophytesSolution.pdf
In what structure does meiosis occur in the bryophytesSolution.pdfIn what structure does meiosis occur in the bryophytesSolution.pdf
In what structure does meiosis occur in the bryophytesSolution.pdf
 
How was it established that particular phenotypes are inherited as a.pdf
How was it established that particular phenotypes are inherited as a.pdfHow was it established that particular phenotypes are inherited as a.pdf
How was it established that particular phenotypes are inherited as a.pdf
 
Given the following homogeneous ODE 2y + 12y + 68y = 0 with initial .pdf
Given the following homogeneous ODE  2y + 12y + 68y = 0 with initial .pdfGiven the following homogeneous ODE  2y + 12y + 68y = 0 with initial .pdf
Given the following homogeneous ODE 2y + 12y + 68y = 0 with initial .pdf
 
For an artist to be considered an outsider, he or she must first be.pdf
For an artist to be considered an outsider, he or she must first be.pdfFor an artist to be considered an outsider, he or she must first be.pdf
For an artist to be considered an outsider, he or she must first be.pdf
 
Find a article or news about Biological ScienceIdentify source (in.pdf
Find a article or news about Biological ScienceIdentify source (in.pdfFind a article or news about Biological ScienceIdentify source (in.pdf
Find a article or news about Biological ScienceIdentify source (in.pdf
 
Discuss in detail the importance of either ageneral standardstan.pdf
Discuss in detail the importance of either ageneral standardstan.pdfDiscuss in detail the importance of either ageneral standardstan.pdf
Discuss in detail the importance of either ageneral standardstan.pdf
 
Distinguish between a blastula, a blastomere, a blastopore, and a bla.pdf
Distinguish between a blastula, a blastomere, a blastopore, and a bla.pdfDistinguish between a blastula, a blastomere, a blastopore, and a bla.pdf
Distinguish between a blastula, a blastomere, a blastopore, and a bla.pdf
 
Compare and contrast an information systems development project in a.pdf
Compare and contrast an information systems development project in a.pdfCompare and contrast an information systems development project in a.pdf
Compare and contrast an information systems development project in a.pdf
 
can high level language can use an assembler.SolutionHigh-l.pdf
can high level language can use an assembler.SolutionHigh-l.pdfcan high level language can use an assembler.SolutionHigh-l.pdf
can high level language can use an assembler.SolutionHigh-l.pdf
 
Briefly describe a mechanim of virus entry into the cells and give o.pdf
Briefly describe a mechanim of virus entry into the cells and give o.pdfBriefly describe a mechanim of virus entry into the cells and give o.pdf
Briefly describe a mechanim of virus entry into the cells and give o.pdf
 
Why are traditional definitions of “interception” problematic when a.pdf
Why are traditional definitions of “interception” problematic when a.pdfWhy are traditional definitions of “interception” problematic when a.pdf
Why are traditional definitions of “interception” problematic when a.pdf
 
why is it important for macromolecular cellular structures to be fle.pdf
why is it important for macromolecular cellular structures to be fle.pdfwhy is it important for macromolecular cellular structures to be fle.pdf
why is it important for macromolecular cellular structures to be fle.pdf
 
Widgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdf
Widgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdfWidgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdf
Widgets ’R Us (WRU) is a medium-sized firm specializing in the desig.pdf
 
Which of the following entities can be homozygous (there may be mor.pdf
Which of the following entities can be homozygous (there may be mor.pdfWhich of the following entities can be homozygous (there may be mor.pdf
Which of the following entities can be homozygous (there may be mor.pdf
 
Where is the lysosomes locales in the cell Where is the lysosom.pdf
Where is the lysosomes locales in the cell Where is the lysosom.pdfWhere is the lysosomes locales in the cell Where is the lysosom.pdf
Where is the lysosomes locales in the cell Where is the lysosom.pdf
 
Which of the following is the most specific of security documents.pdf
Which of the following is the most specific of security documents.pdfWhich of the following is the most specific of security documents.pdf
Which of the following is the most specific of security documents.pdf
 
What is the consequence when a chromosome loses its telomeresSol.pdf
What is the consequence when a chromosome loses its telomeresSol.pdfWhat is the consequence when a chromosome loses its telomeresSol.pdf
What is the consequence when a chromosome loses its telomeresSol.pdf
 
We usually use when having a conversation with others. left hemisph.pdf
We usually use  when having a conversation with others.  left hemisph.pdfWe usually use  when having a conversation with others.  left hemisph.pdf
We usually use when having a conversation with others. left hemisph.pdf
 
The security kernel is found at what protection ring levelA. Ring.pdf
The security kernel is found at what protection ring levelA. Ring.pdfThe security kernel is found at what protection ring levelA. Ring.pdf
The security kernel is found at what protection ring levelA. Ring.pdf
 

Recently uploaded

The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

Hello. This program has to be done in Eclipse(Program used to write .pdf

  • 1. Hello. This program has to be done in Eclipse(Program used to write java code) Write a program that prints the first 30 numbers in the Fibonacci sequence while omitting the third number(it is replaced with an X) Ex: 0,1,X,2,3,X,18..... I have most of the code but, cannot figure out the part on how to delete every third number in the sequence 1 import java.util.*; 2 public class Fibonaccii 3e 4 5 6 7 public static void main (String[] args) i Scanner s= new Scanner (System.in); System. out.println ("Enter you desired value of n: ") int n = s.nextInt(); for (int i = 0; | Solution import java.util.*; public class Fibonacci{ public static int fibonacci(int n){ if (n==0){ return 0; } else if(n==1){ return 1; } else{ return fibonacci(n-1)+fibonacci(n-2); } } public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); for (int i=1; i<=n; i++){ if(i%3!=0){ System.out.print(fibonacci(i-1)+" "); } else{ System.out.print("X "); } }
  • 2. } }