![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2004
Posts: 31
Rep Power: 0
![]() |
please post some nested loops questions ,becoz i would like to solve it
kalinga B) |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Write a sorting algorithm with convergence of O(n^2) --a bubble sort-- to sort any randomly generated data set of values with a randomly chosen number of element 1 <= n <= 100.
Have fun (Actually this is not really complex, lol)
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
I was going to say bubble sort
Oh well.Assuming you know C++: #include <iostream>
#include <conio.h>
bool cArrEq(char first[], char second[]);
void test(char first[], second[]);
void main(int argc, char* argv[]) {
char tests[3][32] = { "test", "test", "test2"};
test(tests[0], test[1]);
test(tests[0], test[2]);
test(tests[1], test[2]);
getch();
}
void test(char first[], char second[]) {
/*
* This is a runtime function so that
* the operations in this function dont
* have to be repeated numerous times in code...
* -- no need to edit
*/
printf("%s == %s\t%d\n", first, second, cArrEq(first, second));
}
bool cArrEq(char first[], char second[]) {
/*
* This function should return a true/false
* value pertaining to if first and second
* are equal to eachother... this should be
* flexible. char arrays should be able to
* be of different sizes and still work.
*/
}Just kidding! I knew this was a VB forum -crawls into fetal position in a corner with an embarassed look-
__________________
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Oct 2004
Posts: 31
Rep Power: 0
![]() |
hey not fair.. to difficult questions. . post some easy questions ... i am still a beginner to programming you know... Post questions related to visual basic
![]() |
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
Alright. Simple challenges... hmmm..
Make code that produces the folling output 1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16
__________________
|
|
|
|
|
|
#6 |
|
Programmer
Join Date: Oct 2004
Posts: 31
Rep Power: 0
![]() |
too bad I solve the problem.. i need more
![]() |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Oct 2004
Posts: 31
Rep Power: 0
![]() |
wait i will post the code..
#include<iostream.h> int main() { int row=0,col=0; for(row=1;row<5;row++) { for(col=1;col<5;col++) { cout<<row*col; } cout<<"\n"; } return 0; } |
|
|
|
|
|
#8 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You said you wanted VB... fine, make an app that asks for a number of lines, and outputs this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 And so on, for the number of lines inputted. Hint: count the number of numbers in each line. |
|
|
|
|
|
#9 |
|
Expert Programmer
|
Bubble sorts are actually easy stuff, just compare and exchange values... look up how it works on google, since it is a very important algorithm to know anyway
![]()
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#10 |
|
Programmer
Join Date: Oct 2004
Posts: 31
Rep Power: 0
![]() |
your question is too difficult ,,I TRIED but cannot do it... wait i'll post the code...
Private Sub Command1_Click() For x = 1 To 5 Step 1 For y = x To 1 Step -1 Picture1.Print y; Next y Picture1.Print Next x End Sub The question you told cannot be done...please post the code... :wacko: |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|