Access over 20 million homework & study documents
search

3 a) Consider the array called datum declared as int datum[N], writ

Content type

User Generated

Rating

Showing Page:
1/2
3. a) Consider the array called datum declared as int
datum[N], write a code fragment that will fill it with zeros
(ie., all element will be set to 0.)
Use a for-loop to fill the array.
Solution
#include<iostream>
using namespace std;
int main(){
int N;
cout<<\"Enter N value: \";
cin>>N;
int datum[N];
for(int i=0; i<N; i++)
datum[i] = 0;
return 0;
}

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up

Unformatted Attachment Preview

3. a) Consider the array called datum declared as int datum[N], write a code fragment that will fill it with zeros (ie., all element will be set to 0.) Use a for-loop to fill the array. Solution #include using namespace std; int main(){ int N; coutN; int datum[N]; for(int i=0; i ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4