Write a statement that declare an array named n of type double with 10 elements
ID: 3908401 • Letter: W
Question
Write a statement that declare an array named n of type double with 10 elements
Write a statement that declares an array named z of type int with 100 elements initialized to 0.
Write a statement that declares an array with 5 elements of type long named longlist with the initial values {8934, 127384, 6637281, 239184, 73562019}
Write a loop that will print the values of the first six elements of the n array.
Write a loop that will assign the values of the z array with the index.
Write a loop that will assign the values of the n array with the sum of index and 3.14159.
Write a loop that will displays the elements of the longlist array in reverse order from the last element to the first element.
Write a loop that computes the sum of the elements of longlist
Write a loop that finds the largest value of the n array elements
Write a loop that finds the smallest values of the z array elements
Write a loop that displays all of the elements whose values are even, each on a different line
Write a loop that displays all of the z array elements, 20 elements per line
Write a loop that displays all of the n array elements, 3 elements per line
Write a loop that finds the mean average of the longlist array elements
Write a block that includes a loop that searches for the integer 76 and displays the index of the found element.
Write a loop that displays all of the elements of the z array whose values are divisible by 5, five elements per line
Write a statement declares an output file pointer named fout that opens mydata.txt located on the C drive in the classdata folder
Write a loop that stores the values of the z array elements in a file using fout
Write a statement that closes fout
Write a statement that declares an input file pointer named fin that mydata.txt located on the C drive in the classdata folder.
Declare an integer variable named myInput and initialize it to 0.
Write a loop that using fin to read each of the first 20 items in the file and store them in myInput (one at a time) and displays each value on the screen.
Explanation / Answer
Now as the Language is not specified using C language to do the same.
1. Array of type double with 10 elements
double n[10];
2.Array of type int with size 100, all initialized to 0
int z[100] = {0};
3.Array of type long having defined values
long longlist[5] = {8934, 127384, 6637281, 239184, 73562019};
4.Loop to print first 6 values of array n
for(i=0; i<6 ;i++)
{
printf("Element [i] = %d ",n[i]);
}
5.Loop to assign values of elements in z with its 's index
for(i=0;i<100;i++)
{
z[i] = i;
}
As we are allowed to answer only 4-5 sub parts of a question, to get answers of further questions, please repost the remaining questions again.
This is all for the question.
Thank You for using Chegg.!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.