SlideShare a Scribd company logo
1 of 5
Listing Program
Fibonacci
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fibo;
/**
*
* @author agatha
*/
public class Fibo {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int fibo[] = new int[15];
fibo[0] = 1;
fibo[1] = 1;
for (int i = 2; i < fibo.length; i++) {
fibo[i] = fibo[i - 1] + fibo[i - 2];
}
for (int i = 0; i < fibo.length; i++) {
System.out.println(fibo[i]);
}
}
}
Bilangan Prima 1-100
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bil_prima;
/**
*
* @author agatha
*/
public class Bil_prima {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
char tanda[] = new char[101];
for (int i = 2; i <= 100; i++) {
if (tanda[i] != '*') {
System.out.print(i + " ");
for (int j = i * 2; j <= 100; j += i) {
tanda[j] = '*';
}
}
}
}
}
Matrik 3x3 Penjumlahan
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package matrik3x3;
import java.util.Scanner;
/**
*
* @author agatha
*/
public class Matrik3x3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner(System.in);
int i;
int j;
int matrikA[][] = new int[4][4];
int matrikB[][] = new int[4][4];
int jumlah[][] = new int[4][4];
for (i = 1; i < 4; i++) {
for (j = 1; j < 4; j++) {
System.out.print("Matrik A " + i + "." + j + "= ");
matrikA[i][j] = input.nextInt();
}
}
System.out.println();
for (i = 1; i < 4; i++) {
for (j = 1; j < 4; j++) {
System.out.print("Matrik B " + i + "." + j + "= ");
matrikB[i][j] = input.nextInt();
}
}
for (i = 1; i < 4; i++) {
for (j = 1; j < 4; j++) {
jumlah[i][j] = matrikA[i][j] + matrikB[i][j];
}
}
System.out.println("n Matrik A n");
for (i = 1; i < 4; i++) {
for (j = 1; j < 4; j++) {
System.out.print(" " + matrikA[i][j]);
}
System.out.println();
}
System.out.println("nMatrik Bn");
for (i = 1; i < 4; i++) {
for (j = 1; j < 4; j++) {
System.out.print(" " + matrikB[i][j]);
}
System.out.println();
}
System.out.println("nMatrik A + Matrik Bn");
for (i = 1; i < 4; i++) {
for (j = 1; j < 4; j++) {
System.out.print(" " + jumlah[i][j]);
}
System.out.println();
}
}
}
Screenshot Program :
1. Fibonacci
2. Bilangan Prima 1-100
3. Matrik 3x3

More Related Content

What's hot

Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
Ayesha Bhatti
ย 
Ds lab manual by s.k.rath
Ds lab manual by s.k.rathDs lab manual by s.k.rath
Ds lab manual by s.k.rath
SANTOSH RATH
ย 
P3
P3P3
P3
lksoo
ย 

What's hot (20)

14method in c#
14method in c#14method in c#
14method in c#
ย 
parameter passing in c#
parameter passing in c#parameter passing in c#
parameter passing in c#
ย 
Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
ย 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
ย 
Functional techniques in Ruby
Functional techniques in RubyFunctional techniques in Ruby
Functional techniques in Ruby
ย 
Functions in C
Functions in CFunctions in C
Functions in C
ย 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
ย 
Method parameters in c#
Method parameters in c#Method parameters in c#
Method parameters in c#
ย 
Python Lecture 4
Python Lecture 4Python Lecture 4
Python Lecture 4
ย 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)
ย 
Lecture#8 introduction to array with examples c++
Lecture#8 introduction to array with examples c++Lecture#8 introduction to array with examples c++
Lecture#8 introduction to array with examples c++
ย 
Functions (Computer programming and utilization)
Functions (Computer programming and utilization)Functions (Computer programming and utilization)
Functions (Computer programming and utilization)
ย 
Functions in c
Functions in cFunctions in c
Functions in c
ย 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
ย 
Presentation on function
Presentation on functionPresentation on function
Presentation on function
ย 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
ย 
Ds lab manual by s.k.rath
Ds lab manual by s.k.rathDs lab manual by s.k.rath
Ds lab manual by s.k.rath
ย 
Lecture#9 Arrays in c++
Lecture#9 Arrays in c++Lecture#9 Arrays in c++
Lecture#9 Arrays in c++
ย 
P3
P3P3
P3
ย 
Bakery Algorithm
Bakery Algorithm Bakery Algorithm
Bakery Algorithm
ย 

Viewers also liked

Laporan Final Project - Aplikasi Sistem Informasi Rental CD - Netbeans
Laporan Final Project - Aplikasi Sistem Informasi Rental CD - NetbeansLaporan Final Project - Aplikasi Sistem Informasi Rental CD - Netbeans
Laporan Final Project - Aplikasi Sistem Informasi Rental CD - Netbeans
Melina Krisnawati
ย 
Tugas algoritma faktorial
Tugas algoritma   faktorialTugas algoritma   faktorial
Tugas algoritma faktorial
Melina Krisnawati
ย 
Pemrograman Mobile - Try Catch
Pemrograman Mobile - Try CatchPemrograman Mobile - Try Catch
Pemrograman Mobile - Try Catch
Melina Krisnawati
ย 
Genius it iansโ„ข 8085 programming (part 2)
Genius it iansโ„ข  8085 programming (part 2)Genius it iansโ„ข  8085 programming (part 2)
Genius it iansโ„ข 8085 programming (part 2)
Manoj Shahu
ย 
Java (Netbeans) - Looping - Object Oriented Programming
Java (Netbeans) - Looping - Object Oriented ProgrammingJava (Netbeans) - Looping - Object Oriented Programming
Java (Netbeans) - Looping - Object Oriented Programming
Melina Krisnawati
ย 
Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)
Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)
Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)
Melina Krisnawati
ย 
Java (Netbeans) - Abstract & Interface - Object Oriented Programming
Java (Netbeans) - Abstract & Interface - Object Oriented ProgrammingJava (Netbeans) - Abstract & Interface - Object Oriented Programming
Java (Netbeans) - Abstract & Interface - Object Oriented Programming
Melina Krisnawati
ย 
Java (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented ProgrammingJava (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented Programming
Melina Krisnawati
ย 
makalah sistem operasi - android vd ios
makalah sistem operasi - android vd iosmakalah sistem operasi - android vd ios
makalah sistem operasi - android vd ios
Melina Krisnawati
ย 
Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)
Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)
Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)
Melina Krisnawati
ย 

Viewers also liked (20)

Laporan Final Project - Aplikasi Sistem Informasi Rental CD - Netbeans
Laporan Final Project - Aplikasi Sistem Informasi Rental CD - NetbeansLaporan Final Project - Aplikasi Sistem Informasi Rental CD - Netbeans
Laporan Final Project - Aplikasi Sistem Informasi Rental CD - Netbeans
ย 
Tugas algoritma faktorial
Tugas algoritma   faktorialTugas algoritma   faktorial
Tugas algoritma faktorial
ย 
Multimedia 2D (Game) - Puzzle alphabet
Multimedia 2D (Game) - Puzzle alphabetMultimedia 2D (Game) - Puzzle alphabet
Multimedia 2D (Game) - Puzzle alphabet
ย 
Pemrograman Mobile - Try Catch
Pemrograman Mobile - Try CatchPemrograman Mobile - Try Catch
Pemrograman Mobile - Try Catch
ย 
Genius it iansโ„ข 8085 programming (part 2)
Genius it iansโ„ข  8085 programming (part 2)Genius it iansโ„ข  8085 programming (part 2)
Genius it iansโ„ข 8085 programming (part 2)
ย 
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
Kode program layout xml dan tampilan ui graphical (menggunakan eclipse)
ย 
Java (Netbeans) - Looping - Object Oriented Programming
Java (Netbeans) - Looping - Object Oriented ProgrammingJava (Netbeans) - Looping - Object Oriented Programming
Java (Netbeans) - Looping - Object Oriented Programming
ย 
Aplikasi sistem informasi pada fungsi fungsi organisasi
Aplikasi sistem informasi pada fungsi   fungsi organisasiAplikasi sistem informasi pada fungsi   fungsi organisasi
Aplikasi sistem informasi pada fungsi fungsi organisasi
ย 
Konsep & storyboard game multimedia (puzzle alphabet)
Konsep & storyboard game multimedia (puzzle alphabet)Konsep & storyboard game multimedia (puzzle alphabet)
Konsep & storyboard game multimedia (puzzle alphabet)
ย 
Algoritma - Array
Algoritma - ArrayAlgoritma - Array
Algoritma - Array
ย 
Laporan praktikum 2 - Sistem Operasi - internal command - copy con, rename,...
Laporan praktikum 2  - Sistem Operasi -  internal command - copy con, rename,...Laporan praktikum 2  - Sistem Operasi -  internal command - copy con, rename,...
Laporan praktikum 2 - Sistem Operasi - internal command - copy con, rename,...
ย 
Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)
Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)
Laporan praktikum 3 - Sistem Operasi Internal & External Command (Lanjutan)
ย 
menu strip - visual basic
menu strip - visual basicmenu strip - visual basic
menu strip - visual basic
ย 
Java (Netbeans) - Abstract & Interface - Object Oriented Programming
Java (Netbeans) - Abstract & Interface - Object Oriented ProgrammingJava (Netbeans) - Abstract & Interface - Object Oriented Programming
Java (Netbeans) - Abstract & Interface - Object Oriented Programming
ย 
Algorithm - Fibonacci Phyllotaxis by Asymmetric Cell Division
Algorithm - Fibonacci Phyllotaxis by Asymmetric Cell DivisionAlgorithm - Fibonacci Phyllotaxis by Asymmetric Cell Division
Algorithm - Fibonacci Phyllotaxis by Asymmetric Cell Division
ย 
Java (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented ProgrammingJava (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented Programming
ย 
makalah sistem operasi - android vd ios
makalah sistem operasi - android vd iosmakalah sistem operasi - android vd ios
makalah sistem operasi - android vd ios
ย 
Laporan Praktikum - Sistem Operasi - Perintah Internal Command
Laporan Praktikum - Sistem Operasi - Perintah Internal CommandLaporan Praktikum - Sistem Operasi - Perintah Internal Command
Laporan Praktikum - Sistem Operasi - Perintah Internal Command
ย 
Laporan pembuatan Final Project (Java - Netbeans) "Rental CD"
Laporan pembuatan Final Project (Java - Netbeans) "Rental CD"Laporan pembuatan Final Project (Java - Netbeans) "Rental CD"
Laporan pembuatan Final Project (Java - Netbeans) "Rental CD"
ย 
Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)
Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)
Java (Netbeans) - Class, Constructor, Object (Object Oriented Programming)
ย 

Similar to Tugas algoritma fibonacci

Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
Erika Susan Villcas
ย 
&Y tgs P kii for
&Y tgs P kii for&Y tgs P kii for
&Y tgs P kii for
Oktavian Dani
ย 
Java_Programming_by_Example_6th_Edition.pdf
Java_Programming_by_Example_6th_Edition.pdfJava_Programming_by_Example_6th_Edition.pdf
Java_Programming_by_Example_6th_Edition.pdf
JayveeCultivo
ย 
Python introduction
Python introductionPython introduction
Python introduction
Joaquim Rocha
ย 
Please find the required program below with output#include stdio.pdf
Please find the required program below with output#include stdio.pdfPlease find the required program below with output#include stdio.pdf
Please find the required program below with output#include stdio.pdf
anonakitchen
ย 

Similar to Tugas algoritma fibonacci (20)

Algoritmos sujei
Algoritmos sujeiAlgoritmos sujei
Algoritmos sujei
ย 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
ย 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
ย 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
ย 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
ย 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
ย 
Stars
StarsStars
Stars
ย 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaan
ย 
Estructura secuencial -garcia
Estructura secuencial -garciaEstructura secuencial -garcia
Estructura secuencial -garcia
ย 
Trabajo
TrabajoTrabajo
Trabajo
ย 
Nested For Loops and Class Constants in Java
Nested For Loops and Class Constants in JavaNested For Loops and Class Constants in Java
Nested For Loops and Class Constants in Java
ย 
What will be the output from the following code if the user enters 4.pdf
What will be the output from the following code if the user enters 4.pdfWhat will be the output from the following code if the user enters 4.pdf
What will be the output from the following code if the user enters 4.pdf
ย 
&Y tgs P kii for
&Y tgs P kii for&Y tgs P kii for
&Y tgs P kii for
ย 
Java parallel programming made simple
Java parallel programming made simpleJava parallel programming made simple
Java parallel programming made simple
ย 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
ย 
Insertion Sort Code
Insertion Sort CodeInsertion Sort Code
Insertion Sort Code
ย 
Xamarin: C# Methods
Xamarin: C# MethodsXamarin: C# Methods
Xamarin: C# Methods
ย 
Java_Programming_by_Example_6th_Edition.pdf
Java_Programming_by_Example_6th_Edition.pdfJava_Programming_by_Example_6th_Edition.pdf
Java_Programming_by_Example_6th_Edition.pdf
ย 
Python introduction
Python introductionPython introduction
Python introduction
ย 
Please find the required program below with output#include stdio.pdf
Please find the required program below with output#include stdio.pdfPlease find the required program below with output#include stdio.pdf
Please find the required program below with output#include stdio.pdf
ย 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
amitlee9823
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
ย 
Call Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 

Recently uploaded (20)

Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
ย 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ย 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
ย 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
ย 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
ย 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
ย 
Call Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Netaji Nagar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
ย 

Tugas algoritma fibonacci

  • 1. Listing Program Fibonacci /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package fibo; /** * * @author agatha */ public class Fibo { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int fibo[] = new int[15]; fibo[0] = 1; fibo[1] = 1; for (int i = 2; i < fibo.length; i++) { fibo[i] = fibo[i - 1] + fibo[i - 2]; } for (int i = 0; i < fibo.length; i++) { System.out.println(fibo[i]); } } }
  • 2. Bilangan Prima 1-100 /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bil_prima; /** * * @author agatha */ public class Bil_prima { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here char tanda[] = new char[101]; for (int i = 2; i <= 100; i++) { if (tanda[i] != '*') { System.out.print(i + " "); for (int j = i * 2; j <= 100; j += i) { tanda[j] = '*'; } } } } }
  • 3. Matrik 3x3 Penjumlahan /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package matrik3x3; import java.util.Scanner; /** * * @author agatha */ public class Matrik3x3 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner input = new Scanner(System.in); int i; int j; int matrikA[][] = new int[4][4]; int matrikB[][] = new int[4][4]; int jumlah[][] = new int[4][4]; for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { System.out.print("Matrik A " + i + "." + j + "= "); matrikA[i][j] = input.nextInt(); } } System.out.println(); for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { System.out.print("Matrik B " + i + "." + j + "= "); matrikB[i][j] = input.nextInt(); } } for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { jumlah[i][j] = matrikA[i][j] + matrikB[i][j]; } } System.out.println("n Matrik A n"); for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { System.out.print(" " + matrikA[i][j]); } System.out.println(); }
  • 4. System.out.println("nMatrik Bn"); for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { System.out.print(" " + matrikB[i][j]); } System.out.println(); } System.out.println("nMatrik A + Matrik Bn"); for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { System.out.print(" " + jumlah[i][j]); } System.out.println(); } } }
  • 5. Screenshot Program : 1. Fibonacci 2. Bilangan Prima 1-100 3. Matrik 3x3