Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

loops


  • Please log in to reply

#1
lilhawk2892

lilhawk2892

    Member

  • Member
  • PipPipPip
  • 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

Advertisements


#2
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
try tutorials

or search on google for:
c++, for
c++, while
  • 0

#3
lilhawk2892

lilhawk2892

    Member

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

#4
bdlt

bdlt

    Member

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

#5
lilhawk2892

lilhawk2892

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 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

bdlt

    Member

  • Member
  • PipPipPip
  • 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;
  printf ("please wait ");
  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

chickenman

    Member

  • Member
  • PipPip
  • 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 :tazz:
  • 0

#8
lilhawk2892

lilhawk2892

    Member

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

#9
skate_punk_21

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


EDIT OK, i Just read your other threads, scratch this - forgive my intrusion :tazz:

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

  • 0

#10
Kronoz

Kronoz

    New Member

  • Member
  • Pip
  • 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

lilhawk2892

    Member

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

#12
gilazilla

gilazilla

    Member

  • Member
  • PipPip
  • 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 . :tazz:
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP