int myArray[N]; //where N is a constant
int mySum = 0;
...
for (int arrayIndex1 = 0; arrayIndex1 < N; arrayIndex1++)
{
cin >> myArray[arrayIndex1];
}
...
for (int int arrayIndex2 = 0; arrayIndex2 < N; arrayIndex2++)
{
mySum +=myArray[arrayIndex2];
}
...
To write a C++ program to display the student details using class and array of object.
How to write a program for mouse in microprocessor?
The simplest way is probably to read the numbers into an array and then prints each element of the array starting at the last one and moving backwards.
maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;}; i don't know
find even number in array
To write a C++ program to display the student details using class and array of object.
write an assembly language program to find sum of N numbers
How to write a program for mouse in microprocessor?
The simplest way is probably to read the numbers into an array and then prints each element of the array starting at the last one and moving backwards.
maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;}; i don't know
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
for(int i = 1; i < 100; i+=2) { System.out.println(i); }
Add the numbers into one variable as you read them in. But if you prefer, you can read the numbers into an array and then use a loop to add the numbers together.
I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.
find even number in array
Reference:cprogramming-bd.com/c_page1.aspx# array programming
The following is for F95 and later (due to the use of intrinsic SUM ): My assumptions: -Your numbers are integers -Your numbers are stored in an array -The numbers you are describing are 0-100 program findSum !I assumed integer, replace this with your data type integer, dimension(100) :: numbers integer :: sumOfNumbers !We populate an array with our numbers !Replace this with your numbers do i=1,(size(numbers)+1) numbers = i end do !We find the sum of those numbers sumOfNumbers = sum(numbers) !We write out the sum to prompt write(*,*) 'Sum is: ', sumOfNumbers end program findSum