after getting to know the language itself and giving myself an overall understanding of it, i started with my first task:
Let your program print out every number from 1-100. If the number is dividable by 3, the program has to print "Fizz" instead of the number. If it is dividable by 5, it has to print "Buzz". If both (dividable by 3 & 5) apply, it has to print "FizzBuzz".
(if i explain smth wrong or if you know easier ways to solve that task, please feel free to comment or text me! i'm more than open for help!)
Well that's how i did it:
first off i went and created an integer variable "num" with the value 100
i built a for loop starting from 0 on and told the program to keep going until it went up to 100 ("<=" means i want it to stop at exactly 100, "<" would end at 99)
inside of the for loop i put a few if statements in
the 1st if tests whether the current number is dividable by 3 and 5
here i put "if (i % 5 == 0 && i % 3 == 0)"... why?
-> "i" is the variable for the number that is "being tested" rn. We want to find out whether it is dividable by 5. For that we use "%".
This means, let's say i=2. How often does 2 fit into 5? 2 times. This results to 4 (2+2=4, another 2 won't fit into 5). now 5-4=1 soooo 2 % 5 == 1. 1 is the rest.
So , back to my code: to find out if "i" is dividable by 5, i%5 has to be equal to 0. If i%5 has any rest, it means that it is not dividable by 5. Same with 3 ofc.
The && here just means "and".
so.. long story short: IF "i" is dividable by 5 AND 3 print "FizzBuzz" (instead of "i") and go on to the next number. if it is not, go into the next if statement
the next "else if" statements say: if it is not dividable by 5 AND 3, is it dividable by 3/ 5 only? IF yes, print "Fizz"/ "Buzz" and keep going with the next number, else: go into else statement
the last else statement says: if you didnt apply to the first few if statements, just print "i"
.. well and that's about it:) programming this one was really fun and i enjoyed sound it so much ahh🩷🩷🖤
Hey there, future coding rock stars! Today, we’re diving into one of the simplest yet most powerful control structures in Java-the if statement. Imagine having the ability to make your code respond to different situations, just like deciding whether to carry an umbrella based on the weather. That’s exactly what the if statement does-it helps your program make decisions! Let’s explore how it works…
IFS Condition In Excel | Advanced Excel Course Online
IFS ফাংশন এক বা একাধিক শর্ত পূরণ হয়েছে কিনা তা পরীক্ষা করে এবং প্রথম সত্য শর্তের সাথে সামঞ্জস্যপূর্ণ একটি মান প্রদান করে। Nested IF Statements এর নতুন আপডেট বলা যেতে পারে এই IFS function কে। IFS formula এর মাধ্যমে multiple if statements কেই আরও সহজে ও সংক্ষেপে প্রকাশ করা যায়।
কিভাবে Microsoft Excel এ রেজাল্ট শীট তৈরি করতে হয়? | Advanced Excel Course Online
কিভাবে Microsoft Excel এ রেজাল্ট শীট তৈরি করতে হয়? Student Result sheet in MS Excel Bangla: ইতিপূর্বে আমরা Microsoft Excel এ IF Function, Excel IFS Function গুলো দেখেছি। আজকে আমরা সেই Excel IF, IFS Condition in Excel, Logical Function ব্যবহার করে student রেজাল্ট শীট প্রস্তুত করবো।
মূলত এই ভিডিওটিকে আমরা IF Statement, IFS Function, Nested If Function, Logical Function এর উপর একটি প্রজেক্ট হিসেবেও বলতে পারি।
In this article, I’m going to give you a tutorial about utilizing multiple IF statements in Power BI. This short tutorial is from a specific thread in the Ent