0% found this document useful (0 votes)
5 views2 pages

Import Java

Uploaded by

mertalisahin66
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Import Java

Uploaded by

mertalisahin66
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

import [Link].

Scanner; // Kullanıcı girişi için şart

public class ButSoru1 {

public static void main(String[] args) {

Scanner oku = new Scanner([Link]);

[Link]("Birinci sayıyı giriniz: ");

int s1 = [Link]();

[Link]("İkinci sayıyı giriniz: ");

int s2 = [Link]();

// Metodu çağırıyoruz ve dönen sonucu 'sonuc' değişkenine aktarıyoruz

int sonuc = farkBul(s1, s2);

[Link]("Girdiğiniz sayıların farkı: " + sonuc);

// Değer döndüren (int) metot yapısı

public static int farkBul(int a, int b) {

int cikarma = a - b;

return cikarma; // Sonucu main metoduna geri fırlatır

}
public class ButSoru1 {

public static void main(String[] args) {

int sonuc = farkBul(25, 10);

[Link]("Hesaplanan Fark: " + sonuc);

public static int farkBul(int a, int b) {

int cikarma = a - b;

return cikarma;

for (int i = 0; i < 100; i += 2) {

[Link](i);

You might also like