Java Tutorial: The for Loop in Java

preview_player
Показать описание
Java For Loop Tutorial: This java tutorial on for loop will teach you about how to use the for loop in java. The for loop in java is about the initialization, condition and the updating. This video explains how each of these things work in java!

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

6:55 answer

Scanner input = new Scanner(System.in);
System.out.println("range of odd numbers :");
int rang = input.nextInt();
for (int i=0; i < rang; i++){
if (i%2 != 0) {
System.out.println(i);
}
}

codemc
Автор

He is making so much efforts and the least we can do is like and share this videos. 🙂

sona_
Автор

Course is getting more exciting and it's great that you are teaching us JAVA

gundujamadar
Автор

only a teacher in my who teach better then everyone.... God bless you harry sir...

lazycoder
Автор

18:04 =

public class PracticeSet05 {
public static void main(String[] args) {
int n = 10;
System.out.println("First n natural numbers are: ");
for(int i=0; i<n; i++){
System.out.println(i);
}
System.out.println("The reverse order is: ");
for(int i=n-1; i>=0; i--){
System.out.println(i);
}
}
}

sushreesomamohanty
Автор

I literally got 50/80 in my final in comp by watching your videos.becsuse I got 7 / 80 in my second term and now I am working hard ..Thank uu very much 🙏

teamrzgaming
Автор

7:46 you could also use the "i+=2" function to print odd numbers just by starting the loop from "1"

muscleinjury
Автор

Hi Harry...I am new to your channel and to be very honest your content is up to mark....to brush up Java concepts your videos are really helpful for

anjalidixit
Автор

17:54
// Decrementing for loop:
System.out.print("Enter a no. to print the natural nos. upto n: ");
int f1 = sc.nextInt();
System.out.println("Printing the natural nos. in reverse order:");
for (int f = f1; f > 0; f--) {
System.out.println(f);
}

devjoychakraborty
Автор

17:49
import java.util.Scanner;

public class ForLoop {
public static void main(String[] args) {
Scanner naturalNumber = new Scanner(System.in);
System.out.print("Enter the total number of natural numbers \nthat you want to print in reverse order: ");
int num = naturalNumber.nextInt();
for (int i = num; i != 0; i--) {
System.out.println(i);
}

}
}

KajalSingh-xgjp
Автор

Great. Harry Bhai, you always make a smile on our face everytime. This revolution is going to be legendary.🙇🏻‍♂️🙇🏻‍♂️

Dxiag
Автор

10:10 We can Simply User : -
for (int e=1; e<=50; e++ ){
System.out.println(e++);
}

akshatgajera
Автор

Found a recommendation to your Channel on Reddit and thank God I did. Thank you for your videos.

goaheadskinit
Автор

int n =15;
for( i=1; i<n ; i- -){
System.out.print(i)
}

lyricspectrum
Автор

18:27

for (int n = 10; n>0; n--){
System.out.println(n);
}

Sir done!!

babitanathsaharia
Автор

Print (" Harry sir is the best teacher for computer science")
Who agree hit like 👍

soletsk
Автор

10:45
More optimize code
public class OddNumbers {
public static void main(String[] args) {
int limit = 10;
System.out.println("Odd numbers from 1 to " + limit + ":");

for (int i = 1; i <= limit; i += 2) {
System.out.println(i);
}
}
}
Output:
1
3
5
7
9

KingCobraYT
Автор

Because of you I am consistently coding java from 2 weeks 👍👍👍👍👍👍👍🤩🤩🤩🤩🤩🤩🤩🤩 Thanks 😊

Sahill
Автор

Thank you very much Harry Sir, I have written the first program of my college's java course by your helpful teaching. Thanks a lot ❤

hitarthshah
Автор

13:36
Yes, it would be valid...the output would be negative numbers, also int is used in the program (int i=5)so there will be no problem while executing the program.The output would be negative numbers i.e integers up to the limit set(in this case it was 5)

yscommunity