*C CODE*
1. Declare an array of doubles of size 75 called scoreBonus and initialize all the elements in the array to 10.5
2.
Declare an array of integers called studentNumbers
The array can hold 112 integers
Prompt and get a number from the user for the third element in the array
Prompt and get a number from the user for the last element in the array
1)
double scoreBonus[75];
int i;
for (i = 0; i < 75; i++)
scoreBonus[i] = 10.5;
2)
int studentNumbers[112];
printf("Enter a number: ");
scanf("%d", studentNumbers+2);
scanf("%d", studentNumbers+111);
*C CODE* 1. Declare an array of doubles of size 75 called scoreBonus and initialize all...
Declare an array of integers called ages The arra bold 119 integers Prompt and get an ange from the user for the fourth element in the artay Prompt and get a score from the user for the last element in the array HTML tau nt ages(11% printf Enter a number for the fourth dlement; scan%,age30 rints Enter a number for the last element, scant, r. ages(119D 5 6 7 8 9 ERT 7 Y U O P F G HUKL
In C language
1. Write a program to declare and initialize an array of size 5 and place odd numbers 3, 5, 7,9 and 11 in it. Declare and initialize another array of size 5 and place even numbers 4, 6, 8, 10 and 12 in it. Write a for loop to add each element and place it in a third array of the same dimensions. Display each array.
*Answer must be in C* Write a program that: 1- Declare and initialize all values to zero an array of doubles 10 x 10 named "cat" 2- Write the code(using for loops) to fill the array with values 1, 2, 3, .... 98, 99, 100 3- Output (using for loops) the sum of the diagonal from 1-100 4- Output (using for loops) the sum of the last 50 rows of the array
Q1) How would you declare an array of doubles called myDoubles? Arrays can be initialized in one of two ways. In one method, the array elements are placed in a list enclosed in curly braces after the array name definition. For example, the code below creates an array of ints with 3 elements: 1, 2 and 3. int[] a = {1, 2, 3, 4}; We can also initialize an array with a new construct, indicating how many elements we want...
Java Code please read comments and add the code to required lines....LINE 1 to LINE 5 ********************************************************************** * Program Summary: This program demonstrates these basic Java concepts: * - Creating an array based on user input * - Accessing and displaying elements of the array * * The program should declare an array to hold 10 integers. * The program should then ask the user for an integer. * The program should populate the array by assigning the user-input integer...
IN C++ Please!! Declare a global integer constant called SIZE and initialize it to 10. • Declare a global enum variable that will support 10 values – each representing an ant colony {A, B, C, D, E, F, G, H, I, J}. • In the main function, o Declare a 2-dimensional array of size the global integer constant, SIZE. The number of rows and columns should be equal to SIZE, which would make this a square matrix. This array will...
[In x86 Assembly Language] Declare a double word array of size 10 and initialize it with some numbers. Find the number of even numbers and the number of odd numbers in this array and save them in locations called oddCount and evenCount.
Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens? Show the code. An array of 1000 integers is declared. What is the largest integer that can be used as an index to the array? Shows the code. Consider the declaration: int v[1]; What is the index of the last element of this array? Declare an array named a of 10 int elements and initialize the elements (starting with the first) to the...
Write code in static void main method class, which creates a boolean array called flags, size 10, and using a for loop sets each element to alternating values (true at index zero, false at index one Write code in a static void main method class, which creates a float array called sales, size 5, uses an initializer list to instantiate its elements with positive values having two decimal places (example 7.25), and using a for loop reads those values of...
Lab Topics • The basics of Array object Use the following Coding Guidelines • When declaring a variable, you usually want to initialize it. Remember you cannot initialize a number with a string. Remember variable names are case sensitive. Use tabs or spaces to indent code within blocks (code surrounded by braces). Use white space to make your program more readable. Use comments after the ending brace of classes, methods, and blocks to identify to which block it belongs. Problem...