answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

Write a program in C plus plus to store 100 element within array and find the particular element if exist?

#include<iostream> #include<iomanip> #include<time.h> template<typename T> size_t find(T& data, T a[], size_t size) { size_t index=0; do { if(a[index]==data) break; } while(++index<size); return(index); } template<typename T> void print(T a[], size_t size) { using std::cout; using std::endl; using std::setw; size_t index=0; do{ if(index&&index%20==0) cout<<endl; cout<<setw(3)<<a[index]; }while(++index<size); cout<<endl; } int main() { srand((unsigned)time(NULL)); const size_t size=100; unsigned int a[size]; size_t index=0; do{ unsigned int data=rand()%100; do{ data=rand()%100; } while(find(data,a,index)<index); a[index]=data; } while(++index<size); print(a,size); }


How do you write a program in c plus plus that reads two integer arrays each having 10 elements and then prints the sum of the products?

#include<iostream> #include<iomanip> #include<time.h> void print(int a[], size_t size) { using std::cout; using std::endl; using std::setw; for(size_t index=0; index<size; ++index) cout<<setw(5)<<a[index]; cout<<endl; } int main() { srand((unsigned)time(NULL)); const size_t size=10; int a[size], b[size], c[size]; // Initialise a and b with random integers (range 1-99) for(size_t index=0; index<size; ++index) { a[index]=rand()%99+1; b[index]=rand()%99+1; } // Initialise c with products of a and b. for(size_t index=0; index<size; ++index) c[index]=a[index]*b[index]; // Calculate sum of c. int sum=0; for(size_t index=0; index<size; ++index) sum+=c[index]; // Print results. std::cout<<"Array a:\t"; print(a,size); std::cout<<"Array b:\t"; print(b,size); std::cout<<"Products:\t"; print(c,size); std::cout<<"Sum product:\t"<<sum<<std::endl; }


What does the new index property return?

The new index property return the selected item number of a list box. Say their is a list box of 1 item the index is 0. You can get the index by one line of code. Listbox1.SelectedIndex.ToString That's all the index does.


What is an index in Java?

An index is basically a numeric association to an element in a collection of data.When you talk about an index in Java, you will most often be talking about the position of an object in an array.int[] numbers = new int[] {10, 20, 30, 40};Given the array declared above:numbers[0] = 10


What is the default index of an array's first position in most languages?

0

Related Questions

Write a program in C plus plus to store 100 element within array and find the particular element if exist?

#include<iostream> #include<iomanip> #include<time.h> template<typename T> size_t find(T& data, T a[], size_t size) { size_t index=0; do { if(a[index]==data) break; } while(++index<size); return(index); } template<typename T> void print(T a[], size_t size) { using std::cout; using std::endl; using std::setw; size_t index=0; do{ if(index&&index%20==0) cout<<endl; cout<<setw(3)<<a[index]; }while(++index<size); cout<<endl; } int main() { srand((unsigned)time(NULL)); const size_t size=100; unsigned int a[size]; size_t index=0; do{ unsigned int data=rand()%100; do{ data=rand()%100; } while(find(data,a,index)<index); a[index]=data; } while(++index<size); print(a,size); }


What is the range of modulation index in am?

The range of modulation index in amplitude modulation (AM) is typically between 0 and 1. A modulation index of 0 indicates no modulation, while a modulation index of 1 represents full modulation where the carrier signal amplitude varies from zero to peak value.


What is a index of reflection?

An index of reflection is a value that represents how much light is reflected off a surface compared to how much is absorbed or transmitted. It is usually expressed as a percentage (0-100%) or a fraction (0-1). A higher index of reflection indicates that more light is being reflected.


How do you work out the index number?

Index numbers are usually expressed by setting some selected value as 100 and converting all other numbers to an index relative to that base.So, for a simple index, if the value y(0) is set to 100, then the index for the value y(k) is y(k)/y(0)*100.The calculations become more complicated if the index is for a collection of items. In such cases, a number of different "sub-indices" need to be combined together. The combined index is calculated as a weighted average of the component sub-indices, with the weights based on the importance of each su-index in the base period (base-weighted) or in the current period (current-weighted).


How do you work out index numbers?

Index numbers are usually expressed by setting some selected value as 100 and converting all other numbers to an index relative to that base.So, for a simple index, if the value y(0) is set to 100, then the index for the value y(k) is y(k)/y(0)*100.The calculations become more complicated if the index is for a collection of items. In such cases, a number of different "sub-indices" need to be combined together. The combined index is calculated as a weighted average of the component sub-indices, with the weights based on the importance of each su-index in the base period (base-weighted) or in the current period (current-weighted).


What type of betting is a binary betting?

Binary bettings is a type of financial betting which displays the price of a bet as an odds index from 0 to 100. The bet settles at 100, if an even happens and 0 if it does not.


What is the Program to find the largest element in an array and position occurrence?

#include<stdio.h> #include<conio.h> main() { int a[100]; int n,largest,index,position; printf("enter the number of elements in the array"); scanf("%d",&n); printf("enter %d elements",n); for(index=0;index<n;index++) scanf("%d",&a[index]); largest=a[0]; position=0; for(index=1;index<n;index++) if(a[index]>largest) { largest=a[index]; position=index; } printf("largest element in the array is %d\n",largest); printf("largets element's position in the array is %d\n",position+1); getch(); }


What is the dimensional formula for relative refractive index is?

The dimensional formula for relative refractive index is [M^0 L^0 T^0].


Write a C program to accept 10 numbers and find the sum and average?

#include using namespace std;int main(){int numberOfElemenets = 10;double myArray[numberOfElements] = {0.0};double sum = 0;for (int index = 0; index < numberOfElements; index++){cout


Change 15 percent to a fraction?

A percentage is already a fraction. It is a numerical proportion (15) out of a whole value (100). Therefore 15% = 15/100 = 3/20 To remember that its always out of 100, think that the percentage sign looks like a lopsided rearragned 100 % = 0 / 0 = / 0 0 = 100 ... it works better when handwritten.


What is difference between key and index in php arrays?

A key is the name of a variable in an array ($array["key"]) and the index is the position it's at ($array = ["key" =&gt; 0], the index would be 0). Keys and indices are the same if the array is not associative though ($array = [true], the key holding the value true is named 0 and is at index 0).


How big is the Statue of Liberty index finger?

Index finger is 8' 0" / 2.44m