Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

# loops

### #1 lilhawk2892 Posted 16 August 2005 - 11:50 AM

lilhawk2892

Member

• Member
• 128 posts
ok so far ive decided to use everything i learned beofre learning smoething else but im stuck wut can i use loops for
• 0

bdlt

Member

• Member
• 876 posts
try tutorials

c++, for
c++, while
• 0

### #3 lilhawk2892 Posted 16 August 2005 - 01:44 PM

lilhawk2892

Member

• Topic Starter
• Member
• 128 posts
PEOPLE GOTTA STOP BRINGING ME THERE ive beeen tere so many times it isnt funny
• 0

### #4 bdlt Posted 16 August 2005 - 01:48 PM

bdlt

Member

• Member
• 876 posts
you are missing the point - you should be going there first
• 0

### #5 lilhawk2892 Posted 16 August 2005 - 02:17 PM

lilhawk2892

Member

• Topic Starter
• Member
• 128 posts
i already have all those bookmarked is wut i mean that where im learning bout loops i just dont know where to use it
• 0

### #6 bdlt Posted 16 August 2005 - 05:57 PM

bdlt

Member

• Member
• 876 posts
here's something to play with:

let's increment an integer until it goes negative. then display the maximum posisitve integer for your version of c++.

```void max_int_test() {
int i = 0;
int max = 0;
while( i >= 0 ) {
max = i;
if( max % 100000000 == 0 ) {
printf (".");
}
i++;
}
printf ("the largest positive int on this PC is %d i = %d", max, i);
}
```

• 0

### #7 chickenman Posted 17 August 2005 - 09:25 AM

chickenman

Member

• Member
• 37 posts
You may also like this (C++)

```#include <iostream>
using namespace std;

int main()
{
int x = 0;
while ( x <= 200 )
{
cout<< x << endl;
++x;
}
cout<<"Done!" << endl;
cin.get();
return 0;
}
```
Enjoy
• 0

### #8 lilhawk2892 Posted 17 August 2005 - 11:02 AM

lilhawk2892

Member

• Topic Starter
• Member
• 128 posts
that last one made sense to me
• 0

### #9 skate_punk_21 Posted 17 August 2005 - 04:38 PM

skate_punk_21

Malware Removal Expert

• Retired Staff
• 1,049 posts
Are you looking for strictly C++ stuff????
```Private Sub
'the following will take a string and reverse it

Command1_Click()

'get word from textbox
originalword = Text1.Text

'loop as many times as there are letters in the string
Do until counter = len(originalword)

'track the counter
counter = counter+1

'get letter in position "counter" (equal to x turn of the loop)
letter = Mid(originalword, Counter, 1)

'place letter at front of a new string.
word2 = letter + word2

'end loop
Loop

'show new string
Text2.Text = word2
End Sub```

Edited by skate_punk_21, 17 August 2005 - 04:46 PM.

• 0

### #10 Kronoz Posted 17 August 2005 - 06:34 PM

Kronoz

New Member

• Member
• 1 posts
Loops would be useful in a character counter.

```#include <stdio.h>
#include <string.h>

int main()
{
printf("Character Counter \n\n\n");
int x = 0;
while (x == 0)
{
char string[10000];
printf ("\nInput string: ");
gets (string);
printf ("String is %u characters long\n",strlen(string));
}
}
```

• 0

### #11 lilhawk2892 Posted 17 August 2005 - 07:38 PM

lilhawk2892

Member

• Topic Starter
• Member
• 128 posts
and um wuts a character counter
• 0

### #12 gilazilla Posted 18 August 2005 - 01:02 AM

gilazilla

Member

• Member
• 39 posts
Loops is also useful in image processing where u can do stuff such as turning a colored picture to grayscale, doing gaussian effect on the pic and etc....sort like what u can do for Photoshop.

It is because you need to use loop to extract information if each pixel of the picture and manipulate it to your desired effect .
• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users