how do you write a program with arrays?
410486
It really depends on which programming language/scripting language you're working with as well as what kind of program you are wanting to write.  I'm guessing that you already know what an array is.  \n\nFor example in JavaScript you would do something like the following:\n \n Declaring arrays:\n \n var arrStudents = new Array()   -- for an empty array\n var arrStudents = new Array(10) -- to declare a certain number of students\n\n  * Always remember that arrays initialize at 0\n\n If you wanted to declare the values of a certain element in an array you would do the following:\n\n arrStudents[0] = Tim\n arrStudents[1] = Bobby ...etc.\n\nArrays can be useful when collecting a large number of responses from a user (such as names, numbers,etc.).  But like I said, it ultimately depends on what kind of a program you are writing.\n\nI provided a website on arrays in the source window below...Good luck on your program.
8922
You can make such a program by following the links given below :\n\nhttp://www.apollowebworks.com/russell/java/lattice.html\nhttp://www.mathsteacher.com.au/year7/ch01_whole/04_mult/mult.htm\n\nAlso, there is a program in the book Programming in C by Brian Tussle
172177
a dynamic array.\nin java a dynamic array is call 'vector' it is under the util package creating a vector is easy it is almost the same as creating an array\n\ninstead of declaring :\nint a[] = new int[10]\nwhich 10 is the limit and u constantly need to set a limit for an array\n\nbut\nin vector you do it like this :\nvector a = new vector();\n\nand then u just add a value into it by :\na.addElement("anything");
841469
Putting it very simply, if you don't have arrays in a language, you will be writing a lot more code to achieve what you can by using arrays.\n\nYou gotta use arrays when you've gotta use them... !\n\nIf this was an interview question, you can just say that given that every single language I know of supports arrays, i don't see the releveance of this question.
41764
you can find a very good tutorial at the link.\n\nNo need to write whats already writtenm =)
791554
Here are the steps you need to take to write this program:\n\n1) Learn to program.\n2) Write your program.\n\nSorry, but there are no shortcuts in programming, no magic "write my program" wizards, no "instant application" kits...\n\nRawlyn.
906761
Try this:\n\nvoid addIt(int* begin, int* end, int x)\n{\nint* p;\nfor (p=begin; p!=end; ++p) {\n*p = *p + x;\n}
44673
Your program ran into code it couldn't execute or data it couldn't address.\n\nIf you wrote the code, look for things like uninitialized pointers, overwritten data structures, and anything else that could corrupt your code or data.
902027
I have used VB for years and as far as I know, it doesnt have dynamic arrays. VB was not designed to be used like that so it probably doesnt have a syntax for it.
881644
Something like this:\n\nint **myArray;\nint s1,s2,i;\n\nprintf("Input row size: ");\nscanf("%d",&s1);\nprintf("Input column size: ");\nscanf("%d",&s2);\n\nmyArray[0] = malloc(s1*s2*sizeof(int));\nif (myArray[0] != NULL ) {\n  for (i = 0;i<s1,i++) {\n         myArray[i] = (i * s2) + myArray[0];\n  }\n}\n\nmyArray can then be used as normal\n\nmyArray[2][4] = 20;
575599
#include<iostream.h>\n\n  int main()\n {\n   int n = 5;\n   for(int i=1;i<=n;i++)\n   {\n    for(int j=n;j<0;j--)\n      cout << * ;\n    }\n }
814965
what c++ program are you referring to ...anyway the syntax is\n\n#include<iostream.h>\n#include<conio.h>\n...include all the header files here ..\n\nint count()\n  {\n     function body\n     return value #integer value to be returned \n\n  }\n\nother functions\n\nvoid main() \n\n   {\n\n# this is the main function \n\nint a,b,c;\nfloat al,bl;\nstring str;\n\n#declare the variables\n\n#get the inputs from the user\ncout<<"enter the value of a ";\ncin>>a;\n...\n...\n\ncall the functions\n\nb=count()\n..\n#do what ever processing has to be done\n } # program closing curly braces\n\n\nhope this helps\n\nthis is a excellent c++ tutorial \n\nhttp://www.geocities.com/sstutor\n\ncprogramming.com is also pretty good
593080
*** pseudocode ****\n\n\n$max = $array[0];\n$min = $array[0];\n\nfor( $x=1; $x <= $size_of_array; $x++ )\n {\n     if($array[$x] < $min)\n       {\n          $min = $array[$x];\n       }\n\n     if($array[$x] > $max)\n       {\n          $max = $array[$x];\n       }\n\n}\n\n\n\n\nhave fun\n\n\nt
293992
Use TOBA (see link below)\n\nToba translates Java class files into C source code. This allows the construction of directly executable programs that avoid the overhead of interpretation.
930134
Multi-Dimensional arrays are declared in FORTRAN by the following syntax :\ntype VARIABLE (index1, index2, index3....)\n\nwhere 'type' is the data type and VARIABLE is the multi-dimensional array variable name\nindex1, index,2 index3..are array elements...\n\nExample\nINTEGER MARK(5,100)\nThis is a two dimensional array.\n\nUsage:\n-------\nthe array can be set with values as follows\nMARK(1,1)=75\nor the array can be equated to a non-dimensional variable like\nA=MARK(1,1)
604143
here is a program for 10 numbers in ascending order\n\n#include <iostream.h>\n#include <conio.h>\n\nvoid main()\n{\nclrscr();\nint array[10],t;\nfor(int x=0;x<10;x++)\n{\ncout << "Enter Integer No. " << x+1 << " : " << endl;\ncin>>array[x];\n}\nfor (x=0;x<10;x++)\n{\nfor(int y=0;y<9;y++)\n{\nif(array[y]>array[y+1])\n{\nt=array[y];\narray[y]=array[y+1];\narray[y+1]=t;\n}\n}\n}\ncout << "Array in ascending order is : ";\nfor (x=0;x<10;x++)\ncout << endl << array[x];\ngetch();\n}\n\nThis program takes in the ten integers array[x] to be stored in the single-dimensional array as a screen input from the user.\nIt then sorts out these ten integers into ascending order and prints them out using the 'cout' command.
280948
I did C++ last year, but don't really remember it that much, so I found some websites that explain two dimensional arrays in C++:\nhttp://www.fredosaurus.com/notes-cpp/arrayptr/22twodim.html\nhttp://mathbits.com/MathBits/CompSci/Arrays/Matrix.htm\nhttp://library.thinkquest.org/C0111571/manual.php?tid=26\nhttp://www.cplusplus.com/doc/tutorial/arrays.html