loops
Started by
lilhawk2892
, Aug 16 2005 11:50 AM
#1
Posted 16 August 2005 - 11:50 AM
#3
Posted 16 August 2005 - 01:44 PM
PEOPLE GOTTA STOP BRINGING ME THERE ive beeen tere so many times it isnt funny
#4
Posted 16 August 2005 - 01:48 PM
you are missing the point - you should be going there first
#5
Posted 16 August 2005 - 02:17 PM
i already have all those bookmarked is wut i mean that where im learning bout loops i just dont know where to use it
#6
Posted 16 August 2005 - 05:57 PM
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++.
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); }
#7
Posted 17 August 2005 - 09:25 AM
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
#8
Posted 17 August 2005 - 11:02 AM
that last one made sense to me
#9
Posted 17 August 2005 - 04:38 PM
Are you looking for strictly C++ stuff????
EDIT OK, i Just read your other threads, scratch this - forgive my intrusion
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
Edited by skate_punk_21, 17 August 2005 - 04:46 PM.
#10
Posted 17 August 2005 - 06:34 PM
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)); } }
#11
Posted 17 August 2005 - 07:38 PM
and um wuts a character counter
#12
Posted 18 August 2005 - 01:02 AM
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 .
It is because you need to use loop to extract information if each pixel of the picture and manipulate it to your desired effect .
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users