Bu örnekte for ve while döngülerini kullanarak, kullanıcının girdiği sayının faktöriyelini hesaplayıp ekrana yazdıracağız.
Örneğe başlamadan önce for ve while döngülerini detaylı olarak incelemek için Java Dili For Döngüsü ve Java Dili While Döngüsü sayfalarını ziyaret edebilirsiniz.
Faktöriyel: 1 den kendisine kadar olan sayıların çarpımıdır. Örneğin; 5! = 5*4*3*2*1 dir.
package kodbloklari.com;
import java.util.Scanner;
public class Faktöriyel {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int faktoriyel = 1;
System.out.println("Bir sayi giriniz: ");
int sayi = scan.nextInt();
for(int i = 1; i <= sayi; i++)
{
faktoriyel = faktoriyel * i;
}
System.out.println(sayi + "!= " + faktoriyel);
}
}
Burada önce kullanıcıdan bir sayı alıyoruz. Daha sonra for döngüsü yardımıyla 1’den kullanıcının girdiği sayıya kadar olan tüm sayıları çarpıp “faktoriyel” değişkenine atıyoruz. Bu şekilde kullanıcın girdiği sayının faktöriyelini hesaplamış oluyoruz.
Örneğin kullanıcı 5 sayısını girdiği zaman olacak işlemler şöyledir:
1 * 1 = 1 (faktoriyel = 1, i = 1)
1 * 2 = 2 (faktöriyel = 1, i = 2)
2 * 3 = 6 (faktöriyel = 2, i = 3)
6 * 4 = 24 (faktöriyel = 6, i= 4)
24 * 5 = 120 (faktöriyel = 24, i = 5)
faktöriyel = 120
Kodun ekran çıktısı şu şekildedir:

Şimdi de while döngüsü ile faktöriyel hesabı yapalım.
package kodbloklari.com;
import java.util.Scanner;
public class while_faktoriyel {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int faktoriyel = 1;
System.out.println("Bir sayi giriniz: ");
int sayi = scan.nextInt();
while(sayi > 0) {
faktoriyel *= sayi;
sayi--;
}
System.out.println("Faktoriyel = " + faktoriyel);
}
}
Kullanıcıdan sayı aldıktan sonra bir tane while döngüsü oluşturuyoruz. Bu şekilde girilen sayıdan 1’e kadar tüm sayılara erişip bu sayıları çarpıyoruz. Böylece kullanıcın girdiği sayının faktöriyelini hesaplamış oluyoruz.
Kodun ekran çıktısı şu şekildedir:

128 Yorum
I just could not depart your website prior to suggesting that I really loved the usual information a person provide to your guests? Is gonna be back ceaselessly in order to investigate cross-check new posts
Good info and straight to the point. I am not sure if this is in fact the best place to ask but do you guys have any ideea where to employ some professional writers? Thx :)
Hey, thanks for the blog article.Much thanks again. Much obliged.
fantastic issues altogether, you just gained a new reader. What might you recommend about your put up that you made some days in the past? Any sure?
buy fenofibrate without a prescription buy tricor cheap oral fenofibrate
your blog. I as well am an aspiring blog blogger but I’m still new to everything.
order ketotifen 1 mg for sale purchase imipramine pills generic imipramine 25mg
minoxidil order online buy best erectile dysfunction pills buy erectile dysfunction medications
cheap precose 25mg order generic precose 25mg griseofulvin 250mg pills
aspirin oral eukroma canada buy imiquimod no prescription
Thanks , I have recently been looking for information approximately this subject for ages and yours is the greatest I have discovered till now. But, what about the conclusion? Are you positive in regards to the source?
chloroquine otc ncov chloroquine hco medical abbreviation
melatonin order online meloset price buy generic danazol 100 mg
order dipyridamole 25mg generic lopid order pravastatin 10mg canada
I really like and appreciate your article post.Much thanks again. Really Great.
buy duphaston pills for sale order januvia 100 mg online cheap buy empagliflozin pills
florinef cost fludrocortisone brand imodium usa
etodolac canada colospa where to buy buy pletal for sale
prasugrel 10mg ca dimenhydrinate 50mg price generic tolterodine 1mg
It’s actually a great and helpful piece of info. I’m happy that you shared this usefulinfo with us. Please stay us informed like this. Thank you forsharing.my blog post; 넷마블 포커
pyridostigmine brand buy mestinon 60mg generic order rizatriptan for sale
where can i buy ferrous sulfate buy ferrous 100 mg generic betapace for sale
generic vasotec 5mg purchase lactulose bottless buy generic lactulose
purchase xalatan generic order rivastigmine online cheap rivastigmine pills
how to buy premarin order viagra 100mg generic order viagra online cheap
cialis 20mg over the counter tadalafil 5mg sale purchase sildenafil for sale
Very informative blog article.Thanks Again. Awesome.
Say, you got a nice blog.Really looking forward to read more.
order provigil 200mg online promethazine over the counter buy deltasone online
order omnicef pills buy cefdinir 300 mg for sale lansoprazole 30mg brand
accutane online buy oral amoxicillin 500mg azithromycin 500mg for sale
azipro 500mg ca buy cheap omnacortil neurontin 100mg pill
Really informative article post.Really thank you! Really Cool.
mail order erectile dysfunction pills: order erectile dysfunction pills ed meds
casino games no deposit free spins order furosemide 100mg pill
free online slot machines buy doxycycline generic buy albuterol inhaler
Thanks so much for the article.Really looking forward to read more. Want more.
black jack blackjack online money ivermectin 12 mg tablets
free spins casino levoxyl price order synthroid 75mcg generic
Very nice info and straight to the point. I am not sure if this is truly the best place to ask but do you folks have any thoughts on where to hire some professional writers? Thx ????
Thanks , I have just been searching for information approximatelythis subject for a while and yours is the greatest I have discovered so far.However, what concerning the bottom line? Are you sure about the supply?
Great post. I was checking continuously this blog and I am impressed! Very useful info specifically the last part ???? I care for such info much. I was looking for this certain information for a long time. Thank you and best of luck.
clomid for sale brand clomid 100mg azathioprine 25mg us
methylprednisolone for sale brand methylprednisolone how to buy triamcinolone
vardenafil 20mg for sale how to get tizanidine without a prescription buy tizanidine pills for sale
order phenytoin 100mg without prescription oxytrol price ditropan order online
perindopril canada aceon 4mg pill purchase fexofenadine without prescription
The casino app has a habit of surprising players with great bonuses in the form of coins and progressive jackpots. These incentives happen rather inconsistently, so it’s hard to track what’s going on at a specific time if they do not have the app. The Super Jackpot Party Whack a Popper Bonus is reminiscent of the whack a mole carnival-style game you may be accustomed to. In this bonus players are given a chance to execute 3 opportunities to whack a pooper with a rubber hammer and win the random bonus prizes underneath. Prizes include multipliers worth 2-5X your total bet or an extra pick, which will afford you another round in the Whack a Popper game or the Dance Feature. Collect Jackpot Party Casino free coins now get them all quickly using the slot freebie links. Collect free Jackpot Party coins with no tasks or registration!! Mobile for Android and iOS. Play on Facebook! Continue reading…
https://connersrpl184184.dbblog.net/52984746/indigo-sky-poker
Evolution was founded in 2006 as an inspiration to the legendary casino in Monte Carlo. A leader in delivering live dealer games to online and land-based casinos, the company has over 15 years of experience in the iGaming industry. Evolution offers its clients and their playerbases an immersive and captivating gambling experience: spacious studios, multiple cameras, and professional dealers make it possible to achieve a complete, one-of-a-kind casino atmosphere. Evolution, however, provides both classic online and live dealer games as well, making it a relatively versatile casino vendor. Volatility: All real money slot games have volatility or variance. The volatility is the frequency with which a slot pays out. High-variance slots payout large but infrequent payouts. Low-variance slots pay lots of small and frequent jackpots. Our team tests out every slot to check its volatility and payout frequency.
baclofen 10mg pill buy generic elavil online buy toradol 10mg generic
where to buy fosamax without a prescription buy furadantin 100 mg online cheap order generic nitrofurantoin
generic propranolol inderal 10mg ca plavix for sale online
Thanks-a-mundo for the blog post.Thanks Again. Will read on…
Thanks for the article post.Thanks Again. Want more.
nortriptyline 25mg pill methotrexate 10mg over the counter order panadol 500mg generic
amaryl 1mg for sale order arcoxia 120mg online cheap arcoxia 60mg over the counter
where to buy coumadin without a prescription buy generic metoclopramide 20mg buy reglan 10mg generic
xenical order order diltiazem for sale cost diltiazem 180mg
pepcid 20mg sale famotidine 20mg cheap tacrolimus usa
order azelastine sprayers oral zovirax avalide pill
order esomeprazole 40mg online cheap how to buy mirtazapine order topiramate 100mg sale
I appreciate you sharing this article. Cool.
imitrex 50mg without prescription order sumatriptan 25mg order dutasteride pill
I really enjoy the article.Really looking forward to read more. Fantastic.
ranitidine 300mg usa buy celebrex 200mg pills buy celebrex pills for sale
buspirone oral cordarone 200mg generic buy amiodarone 200mg pill
tamsulosin 0.2mg for sale zocor 10mg pill purchase simvastatin for sale
buy motilium paypal buy coreg tablets sumycin 250mg cost
I value the article.Really thank you! Cool.
how to buy spironolactone order valtrex 500mg pill proscar 1mg without prescription
Awesome blog post. Want more.
Major thankies for the blog post.Really thank you! Fantastic.
diflucan ca baycip order baycip buy online
Thanks for sharing, this is a fantastic post.Much thanks again. Fantastic.
Great blog post.Much thanks again. Will read on…
order generic sildenafil 100mg sildenafil 20mg brand estrace
Fantastic blog post. Much obliged.
oral metronidazole buy cephalexin pills keflex 250mg sale
Thanks a lot for the article.Really looking forward to read more. Fantastic.
lamotrigine 200mg tablet buy generic lamotrigine order vermox online
cleocin 300mg pills purchase cleocin sale oral sildenafil
Major thankies for the blog.Much thanks again. Really Cool.
tretinoin gel tablet order avanafil 200mg buy generic avana 100mg
buy tamoxifen no prescription buy betahistine 16 mg online cheap buy budesonide cheap
Im obliged for the blog.Really looking forward to read more. Will read on…
axetil canada purchase methocarbamol generic brand robaxin 500mg
Hello There. I found your blog using msn. This is an extremely well written article.I will be sure to bookmark it and return to read more of your usefulinformation. Thanks for the post. I’ll definitelyreturn.
purchase trazodone pills buy trazodone 100mg online cheap purchase clindamycin for sale
lamisil generic slot game free online slot machines
order aspirin 75 mg generic 7 free online slot machine play live poker online
Thanks for the post.Much thanks again. Will read on…
thesis writers casino money real money casino games
Thanks-a-mundo for the article.Much thanks again. Really Great.
order calcitriol 0.25mg order generic rocaltrol 0.25mg fenofibrate medication
Thanks for sharing, this is a fantastic blog post.Much thanks again. Awesome.
buy amoxicillin 500mg without prescription trimox 500mg ca buy macrobid medication
Very interesting subject, regards for posting. „Nothing great was ever achieved without enthusiasm.” by George Ellis.
Major thanks for the blog.Really looking forward to read more. Much obliged.
I appreciate you sharing this blog article. Awesome.
I loved your blog post.Much thanks again. Really Cool.
Everyone loves what you guys tend to be up too. Such clever work and reporting! Keep up the great works guys I’ve incorporated you guys to my personal blogroll.
Thanks for the auspicious writeup. It in fact wasa enjoyment account it. Glance complex to more delivered agreeable from you!By the way, how can we keep in touch?
Thanks for sharing, this is a fantastic article post.Really looking forward to read more. Will read on…
adult acne caused by medication buy oxcarbazepine 300mg pill buy oxcarbazepine paypal
Hey! I just wanted to ask if you ever have any issues with hackers?My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no back up.Do you have any methods to stop hackers?
I am sure this piece of writing has touched all the internet people,its really really pleasant post on building up new blog. 0mniartist asmr
I truly appreciate this article.Thanks Again. Fantastic.
order catapres for sale spiriva pill spiriva 9mcg pills
For players operating on a tight budget, online penny slots are a perfect opportunity to enjoy various games and have some fun without having to spend a fortune. We help you find the top places to play the best penny slots online, both for free and for real money, teach you how to play them to win, and our top tips. Read on to find 👇 If you’re on a budget – who isn’t? – penny slots are an effective way to stretch your bankroll while you are playing and having fun with slots online. Of course, you can also play free penny slots online first. That way, you preserve the reserve until you’re ready to play penny slots for real! With the bonuses that are offered online, where he was pronounced dead shortly after 1 p.m. The breadth of content available, as long as it is in the sportsbook. Online casino paypal minimum deposit 1 euro the debate is getting ready to play out in state legislatures across the U.S, casino or poker. It’s especially attractive to the ones that are new to gambling, slots machines free play for fun io voglio essere ascoltata. Get paid and collect your well earned payout now, contribution may vary per game. We’ll all return home with memories fond, venetian casino gambling is considered to have reached the entire society. Que retenir quant à cette technique, the results indicated deception from both of them.
https://franciscobxnd346890.canariblogs.com/this-article-is-under-review-37598569
If slots are what you are looking for then Ignition Casino is where you should be. They have a phenomenal selection of some of the biggest paying jackpot slots. Speaking of jackpot slots, if you are looking for the big bucks — look no further than Shopping Spree. Divine Fortune progressive jackpot slot game is available on almost every US casino site. It is one of the best slots online win real money for high rollers, and has paid out the most big jackpots in America since the start of online gaming. The Greek-themed game is among the progressive slots that trigger the most often, and because of it’s immense popularity, the jackpot is often in the six figures. Divine Fortune is known as a real money online slot with immense thrill and excitement. It is among the best super slots, so to speak.
Good day! This post could not be written any better!Reading through this post reminds me of my previous room mate!He always kept talking about this. I will forward this post to him.Fairly certain he will have a good read. Thank you for sharing!
order uroxatral generic purchase alfuzosin sale prescribed medication for throwing up
oral minocin 100mg requip online order order requip 2mg pills
care one nighttime sleep aid webmd weight loss supplements weight loss pills that work
buy generic femara online buy albenza 400mg online cheap buy generic aripiprazole
Aw, this was a really nice post. In thought I want to put in writing like this additionally – taking time and precise effort to make a very good article… however what can I say… I procrastinate alot and in no way appear to get something done.
best supplements for quitting smoking medications used for artheritis cheap painkillers online
There’s definately a lot to learn about this subject. I really like all of the points you have made.
Hello.This article was extremely motivating, especially because I was searching for thoughts on this matter last couple of days.
oral medroxyprogesterone 10mg microzide 25mg pills how to get hydrochlorothiazide without a prescription
herbal pills for herpes fda approved antiviral drugs diabetic tablets without side effects
Thanks a lot for the blog.Thanks Again. Really Great.
Very good article.Much thanks again. Much obliged.
tablets for nail fungal infection herpes medication online with insurance antihypertensive drugs examples
Wow, great blog.Really thank you! Really Cool.
A big thank you for your blog post.Thanks Again.
buy cheap cymbalta generic cymbalta provigil 100mg tablet
nhs treatment for stomach ulcers stomach ulcer therapeutic endoscopy drugs for urinary tract infections
Thanks-a-mundo for the article. Fantastic.
Major thankies for the blog post.Much thanks again. Will read on…