Showing posts with label For Loop. Show all posts
Showing posts with label For Loop. Show all posts

Saturday, October 24, 2026

Loops in C Language For While Do While in Telugu Part-6 | LearnTechSoft

Loops in C Language | For, While, Do-While in Telugu

Part-6: Oke pani 100 sarlu ela cheyali? - LearnTechSoft

💡 Real Life: Roju gym lo 50 pushups - Oke pani malli malli - Ade Loop! C lo 1 nundi 100 varaku print cheyali ante 100 lines rayakunda Loop vadatam.

1. Loop ante enti? 3 Types

LoopUse Eppudu?
for loopEnni sarlu repeat avo kavalo teliste
while loopCondition varaku repeat
do-whileOkasari compulsory run avvali ante

2. For Loop - No.1 Important

for(initialization; condition; increment) {
    // Code repeat avtundi
}

// Example: 1 to 10 print
for(int i=1; i<=10; i++) {
    printf("%d\n", i);
}
Parts: i=1 (Start) | i<=10 (End varaku) | i++ (Prati sari +1)

3. While Loop

int i=1;
while(i<=10) {
    printf("%d\n", i);
    i++; // Idi marchipothe infinite loop!
}

4. Do-While Loop - Difference enti?

Key Difference: While - First check, taruvata run. Do-While - First run, taruvata check. So do-while okasari ayina compulsory run avtundi.
int i=1;
do {
    printf("%d\n", i);
    i++;
} while(i<=10);

5. Super Programs - Interview lo adugutaru!

Program 1: 1 to 100 Sum
int sum=0;
for(int i=1; i<=100; i++) {
    sum = sum + i;
}
printf("Sum = %d", sum); // Output: 5050
Program 2: Multiplication Table
int n=5;
for(int i=1; i<=10; i++) {
    printf("%d x %d = %d\n", n, i, n*i);
}

6. Break & Continue - Extra

  • break: Loop nundi bayataki vachesey - Ex: 5 vaste aapesey
  • continue: Oka sari skip chesey - Ex: 5 ni vadilesey

🎯 Next Post: Arrays in C Language - Full Guide in Telugu

Homework: 1-50 even numbers, Table 1-10 print - Roju practice!

Abstraction in Java - Explained in Simple Words with Examples in Telugu | LearnTechSoft Abstraction in Java - Explained in Simpl...