Technology is addicting and distracting, just take personal experience. Have you ever had a time when you were on the computer, on the phone, playing games, watching TV, etc. and time flew by? You were procrastinating and should have been doing something else? Were you ever multitasking and paid more attention to technology than what you should be doing? If so, then you have your answer, and from your own experience as well.
Answer:
0
Explanation:
As far as I know, no one I know, even knows that brainly exists. Those who do know about it don't use it.
Answer:
int main() {
int _2dArray[32][32];
for (int i = 0; i < 32; i++) {
for (int j = 0; j < 32; j++) {
_2dArray[i][j] = j + i * 32;
}
}
return 0;
}
Explanation:
Here is a generic C/C++ 2d array traversal and main function example. The rest you'll have to figure out based on what kind of app you're making.
Good luck!
Answer:
Explanation:
#include<iostream>
#include<ctime>
#include<bits/stdc++.h>
using namespace std;
double calculate(double arr[], int l)
{
double avg=0.0;
int x;
for(x=0;x<l;x++)
{
avg+=arr[x];
}
avg/=l;
return avg;
}
int biggest(int arr[], int n)
{
int x,idx,big=-1;
for(x=0;x<n;x++)
{
if(arr[x]>big)
{
big=arr[x];
idx=x;
}
}
return idx;
}
int main()
{
vector<pair<int,double> >result;
cout<<"Enter 1 for iteration\nEnter 2 for exit\n";
int choice;
cin>>choice;
while(choice!=2)
{
int n,m;
cout<<"Enter N"<<endl;
cin>>n;
cout<<"Enter M"<<endl;
cin>>m;
int c=m;
double running_time[c];
while(c>0)
{
int arr[n];
int x;
for(x=0;x<n;x++)
{
arr[x] = rand();
}
clock_t start = clock();
int pos = biggest(arr,n);
clock_t t_end = clock();
c--;
running_time[c] = 1000.0*(t_end-start)/CLOCKS_PER_SEC;
}
double avg_running_time = calculate(running_time,m);
result.push_back(make_pair(n,avg_running_time));
cout<<"Enter 1 for iteration\nEnter 2 for exit\n";
cin>>choice;
}
for(int x=0;x<result.size();x++)
{
cout<<result[x].first<<" "<<result[x].second<<endl;
}
}