How do you list an array for 8?
823906
not quite sure what exactly you mean, but i would guess\n\n2+2+2+2 or 4+4 or 1+1+1+1+1+1+1+1
528238
either do direct value initialization inside the bracket\n\nint MyArrayD[N]={0,0,0,0,0,0,0,0..};\n\nor \n\nfor(int i = 0; i <N; i++}\nMyArrayD[i]=0;
195373
Try this:\n\n#include <stdio.h>\n\nmain()\n{\nint size,array[50],n,m,border,max,buf,step;\nint i, j, temp;\n\nprintf("Input number of elements in array:");\nscanf("%d",&size);\n\nfor(n=0;n<size;n++) {\n  printf("input %d. element of array:",n+1);\n  scanf("%d",&array[n]);\n  }\n\n for (i=(size-1);i>=0; i--)\n  {\n   for(j=1;j<=i;j++)\n    {\n     if(array[j-1]>array[j])\n      {\n       temp=array[j-1];\n       array[j-1]=array[j];\n       array[j]=temp;\n      }\n     }\n   }\n\nfor(n=0;n<size;n++)\n   printf("%d. element: %d&#92;n",n+1,array[n]);\n\n}\n\n\n\nHERE IS MY OUTPUT:\n\nInput number of elements in array:8\ninput 1. element of array:6\ninput 2. element of array:2\ninput 3. element of array:3\ninput 4. element of array:5\ninput 5. element of array:1\ninput 6. element of array:4\ninput 7. element of array:5\ninput 8. element of array:7\n1. element: 1\n2. element: 2\n3. element: 3\n4. element: 4\n5. element: 5\n6. element: 5\n7. element: 6\n8. element: 7
971944
First: Check if the string has more than 4 letters.. Otherwise you cannot add a character in the 5th place.\n\n(If you dunno how to do this, use a counter variable. Traverse thru the list one by one, incrementing the counter variable for each traversal until u reach the end of the list)\n\nOnce that check is done and you are sure that there 4 or more letters in the string, u can proceed with the following:\n\nlet your list pointer (pointer to the first element in the list) be called "LIST".. \n\n1. Create a new pointer (lets call it "NEW") and point it to LIST. Let the new character be present at the location called CHARACTER. (For this you need to create a node and call it "CHARACTER").\n2. Create a counter variable\n3. Now traverse through the list one by one using the NEW pointer (do not disturb the LIST pointer). Simultaneously increment the counter once for each traversal.\n4. After each traversal, check the counter value. Once the counter reaches the requisite value (4 or 5, depending on whether u initialised it to 0 or 1), insert the new character in that place.\ni.e.: \n       next(CHARACTER) = next(NEW)\n       next(NEW) = CHARACTER \n\nHope this helps.
779597
The 'unique' function will return all distinct values in an array:\n\nMyData =\n\n     8\n     2\n     5\n     4\n     8\n     7\n     4\n     1\n     7\n     4\n     5\n     7\n\n>> unique(MyData)\n\nans =\n\n     1\n     2\n     4\n     5\n     7\n     8
183720
Here's the answer:\n\n88 - 8 x 8 = 640\nPut in a calculator and you will see it work. =>
700889
U know how to create an array containing 20 grades of 20 students? i.e array[0]=grade of student 1, array[1]= grade of student 2, and so on. After defining that array, u can consider this code:\npublic double max_grade(double[] array){\n   double max = array[0];\n   for( int i=0; i<20; i++){\n      if (max<array[i]){\n         max = array[i];\n       }\n    }\n    return max;\n}
943372
u have to ponit it or use\n\nthese are the 2 way's:\n\n#include <iostream>\nusing namespcae std;\nint main()\n{\nint num[8];\nint index;\n\nnum[0] = 42;\nnum[1] = 2001;\nnum[2] = 7;\nnum[3] = 180;\nnum[4] = 99;\nnum[5] = 1993;\n\nfor(index = 0; index <= 5; index++)\n{\nstd::cout<< index[num] << endl;\n}\n system("pause");\nreturn 0;\n}\n\nor\n\n#include <iostream>\n#define MAX 20\nusing namespcae std;\n\nint main()\n{\n\nint a[MAX] = {23,43,4,5,34,343,12,14};\nint b;\n\ncout.setf(ios::right);\n\nfor(b = 0; b < MAX; b++){\n\ncout << endl << endl;\n\ncout << "The Elemnt in ";\n\ncout.width(2);\n\ncout << (b +1) << " is ";\n\ncout.width(2);\n\nstd::cout << b[a];\n}\nreturn 0;\n}
861563
You mean you want to add data to an existing array?\n\nIf so use array_merge or array_push
816710
Create an outer for loop that will loop from 7 down to 0, with a step of 2.\n\nCreate one inner loops.\n\nThe inner loop should take the value of i, place it in another variable and count down to 0.\nThen print out the dollar signs for each iteration of this loop.
981994
pseudo code sort of, based on C++... easiest for me... I am going to do this with an array of integers because the number of integers read into the program can be different than just three.  This can be easily changed though...\n\nstart program:\n\nint arrayInt[3];  //  places to store three integers\nint largestNumber = 0;  // place to store largest number\ncout << "enter three numbers:  ";   // request for three numbers\nfor (int i = 0; i < 3; i++)\n{     cin >> arrayInt[i]; }    \n// takes the three values from the user's input and stores them in an element in the arrayInt array.\n// so... now you need to compare all of the elements in arrayInt\nfor (int i = 0; i < 3; i++)  // do this three times\n{\n     if ( arrayInt[i] > largestNumber )  \n// comare largestNumber to the current element in the array\n// if it is larger, give largestNumber the value of that element\n     {\n         largestNumber = arrayInt[i] );\n     }\n}\n\n// display the largest number\ncout << "the largest number is:  " << largestNumber << endl;\n\n ******************************************************************\n\n1. initialize variables for the three input integers and a variable to store the largest integer (set this one equal to zero).\n2. ask the user for the three numbers\n3. read the user's input into the variables to store them\n4. compare the values stored in the three variables by either doing it individually (if an array is not used) or with a for loop.  Go through each of the three variables that store the user's input and compare the stored value to the largestNumber variable.  The largestNumber variable should be set equal to 0 since we know that all the numbers will be non negative, therefore 0 is the lowest any of the input numbers can be.  If the value of a variable that stores a user given integer is larger than the largestNumber variable, store the value of the input variable in the largestNumber variable ( largestNumber = inputValue2 ).  As you check all of the three input variables, the largest of all of the values checked will be stored in the largestNumber variable. \n5. tell the user the largest variable
765887
Assuming your above program works, which I don't think it will because your doing an aggregate operation on an array..you should assign values to indexes in the array...eg cin >> Date[0] or use a for loop or something...regardless since your putting everything in an array anyway simply do something like using a counter variable, personally i think it would be the easiest way of doing something like that.\n\nint counter = 0;\n\ncout << enter day to subtract << endl;\ncin   >> counter;\ncout << Date[1]  - Date[counter] << endl;\n\nI belive using
985771
You can generate this in one line of Perl, Unix scripting, or a small C/C++ program.  Simply write one number per line from your program counter.  You may have to get tricky and use two long ints, but it's not hard.\n\n Realize that your document may be very large, and for most purposes, you don't need a document, just use the variable(s) in your final program.
101541
This is kinda wierd without drawing it out, but I'll try to explain and you can come up with the picture.\n\n1)  Start Program\n2)  Accept Input\n3)  Add 1 to counter\n4)  If counter is not equal to 3; go to #2\n5)  If N2 > N3, do #6-8; if not, go to #9\n6)  Move N3 to a hold field\n7)  Move N2 to N3\n8)  Move the hold field to N2\n9)  if N1 > N2, do #6-8 with the N1 & N2 replacing each other\n10) if N2 > N3, do #6-8\n11) print them
642129
ok, here is one declaration, of many;\n\nfloat Doc(int arr[100], int NumCt)\n{\nfloat sum = 0.0;\nfor (int i = 0; i < NumCt; i++)\nsum += arr[i];\n\nif (!NumCt)\nreturn sum;\n\nreturn sum / NumCt;\n}
1047890
class C\n{\npublic:\nenum { NUM_VALUES = 10 };\n\nprivate:\ndouble m_values[NUM_VALUES];\n\npublic:\n// Sets the number stored at index i in m_values to v\nvoid SetValue(int i, double v) throw( std::exception )\n{\nif ( i < 0 || i >= NUM_VALUES ) throw std::exception("Index out of range");\nm_values[i] = v;\n}\n\n// Gets the number stored at index i in m_values\ndouble GetValue(int i) const throw( std::exception )\n{\nif ( i < 0 || i >= NUM_VALUES ) throw std::exception("Index out of range");\nreturn m_values[i];\n}\n\n    // Returns the mean of the numbers stored in m_values\n    double GetMean(void) const \n    {\n        double sum = 0;\n        for ( int i = 0; i < NUM_VALUES; i ++ ) sum += m_values[i];\n        return sum / NUM_VALUES;\n    }\n\n    // Returns the sample standard deviation of the numbers stored in m_values\n    double GetStandardDeviation(void) const \n    {\n        double mean = GetMean();\n        double sum = 0;\n        for ( int i = 0; i < NUM_VALUES; i ++ ) sum += (m_values[i]-mean)*(m_values[i]-mean);\n        return sqrt(sum/(NUM_VALUES-1));\n    }\n};
864795
8(t-2sqrt(a))(t+2sqrt(a))