Write a program that reads 8 floating point values into an array and then prints out the second, fourth, sixth and eighth members of the array, and the sum of the first, third, fifth and seventh, using pointers to access the members of the array.
Q: Write a program in Java to using one dimensional array to do the following. I. Read 10 elements into…
A: 1)Declare array and initialize sum=0 2)read elements into the array using for loop 3)Display the…
Q: Write in C++ programming language a complete program to declare a two-dimensional array of integer…
A: Logic:- Use nested loop to enter values in 4 by 6 matrix. for(int i=0;i<4;i++) {…
Q: Write a program that copies an array including the following days: Sat,Sun,Mon,Tue,Wed,Thu,Fri The…
A: Given:
Q: Write a program in c language to: 1. store elements in an array and print it. 2. read n number of…
A: EXPLANATION: - 1. store elements in an array and print it. The integer[] is declared and…
Q: Given an array below, write a program in C++ to print all numbers which are greater than the average…
A: Given: int array[10] = {1,10,-8,16,-12,34,0,19,-23,14} Requirement: Write a program in C++ to print…
Q: 12. In the JAVA language write a program to input the elements of two integer arrays A1, A2 of size…
A: In the JAVA language write a program to input the elements of two integer arrays A1, A2 of size 10…
Q: Write a program which read the following (3x3 dimensional) array and then display it. 10 50 70 40 80…
A: Please find the solution for the above program in C++.
Q: Write a program in java or c# that creates an integer array of size 10 and fills the array with…
A: The programming methodology for the program is given by: Importing packages Main class Function…
Q: Write a C program that asks the user for 10 integer numbers and stores these numbers in an array.…
A: Algorithm: Start Set i=0 Set sum=0 Read A[i] Compute: sum +=A[i] Set i=i+1 IF i<10 go to step 4.…
Q: Write a java program that fills in an array with up to 10 characters and then searches the array for…
A: import java.util.Arrays; import java.util.Scanner; public class BinarySearch { //main method…
Q: Write a program that will ask the user to give five numbers and then it will search for the biggest…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: Write program to display values of integer array and use dereferencing to change array values using…
A: Using dereferencing we are changing the values of the array using the pointer
Q: PROGRAM in JAVA Write a program that defines two arrays - one of strings and one of integers,…
A: Hello Student. Greetings from my side. Hope you are doing great. As per our policy guidelines, in…
Q: write a program to create a one dimensional array. get the number of element from the user and the…
A: Program code: //inlcuding necessary data package import javax.swing.*; //main class public class…
Q: Write a program that declares two arrays of integers. Fill the first one from the user and the…
A: As per guidelines, we are supposed to answer only one question. Kindly repost other question as a…
Q: Write a program that creates an integer array of size 10 and fills the array with values set by the…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output int…
Q: Write a program which read the following (3x3 dimensional) array and then display it. 50 80 70 30 10…
A: Use a 2d array to store elements and then print it
Q: Write a program that simulates a magic square using 3 one-dimensional parallel arrays of integer…
A: Since the programming language is not mentioned , I have done the code in C++. Algorithm :…
Q: write a program using pointers to find the smallest index of the large element : often you need to…
A: #include <stdio.h> int main(){ int arr[] = {1, -1, 5, 2, 3, 5, 2, -5}; int *ptr; int…
Q: Example: - Write a program that reads from the user an array with one dimension n and sort the…
A: Given:
Q: Write a program that will accept 5 employee names, department code, and hours worked. The program…
A: In this question, we are asked to write a java program which takes input of 5 employees and…
Q: Write a program in C++ language to print the number of elements that are divided by 5 without the…
A: Program: The main objective of the program is to perform the tasks according to the instruction…
Q: Given an array below, write a program in Java language to print all numbers which are greater than…
A: Given an array below, write a program in Java language to print all numbers which are greater than…
Q: Write a program that first reads an integer for the array size, then reads numbers into the array,…
A: In this question we have to write a C program as we have to use the pointer to access the array for…
Q: Write a program that accepts two integer values, called "arraySize" and "multiplier", as user input.…
A: Program: //include the required header files #include<iostream> //use std using namespace…
Q: Write a program that counts the number of letters in each word of the Gettysburg Address and stores…
A: the answer is an given below :
Q: Write a program to generate and print a two dimensional array as rowl: 0 3 6 9 row2: 2 5 8 11 row3:…
A: Answer the above question are as follows
Q: Write a program in C that uses a single-dimension array to store 10 numbers input by a user. After…
A: Define header file <stdio.h> for io operations. Define main function. Define int variables x…
Q: write a program that define 2 arrays of 10 students, one for names and the other for marks (0-20).…
A: Logic: Run a loop for all array elements Calculate sum of student marks consider first…
Q: ive solution of both parts: Part a: Write a C++ program to display address of each element of an…
A: Step 1: Accept size of array from user Step 2: Declare array with size Step 3: Accept values for…
Q: Write a program which takes 2 arrays of 10 integers each a and b. c is an array with 20 integers.…
A:
Q: hat creates an array data of size 8, representing a binary number of 8 bits. The user must…
A: Write a Java program that creates an array data of size 8, representing a binary number of 8 bits.…
Q: Write a program that will take a pointer to the array as input and calculate if the number on which…
A: NOTE: Since programming language is not mentioned. Therefore answering questions in C language. We…
Q: Write a Java program that defines a two-dimensional array named scores of size 4x3 of type integer.…
A: The objective of the given problem is to read data from the text file and store it into a 2D array…
Q: Write a java program that reads 10 integer numbers and store them in an array, then display the…
A:
Q: rite a c++ program that uses to input eight integer numbers into an array named temp. As each…
A: Define header file <iostream> for io operations. Define function main. Define int variable n…
Q: Write a C++ program to accept 3 numbers and it can be in decimal point. The number will
A: Introduction: In this question, we are asked to write a C++ program to insert the 3 numbers into an…
Q: Write a program that uses pointers to set each element of an array to zero.
A: Step 1:- Note:-I am writing the solution in C programming language. Array:- The array is defined as…
Q: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer…
A: Since programming language is not mentioned in the question, we will answer this question in the C++…
Q: Write a program that reads 10 integers stored in an array and an integer, counts the occurrence of…
A: Let us see the answer - Introduction- Array- Instead of defining distinct variables for each item,…
Q: Write a program to check whether a given word is a palindrome by using pointers A palindrome is a…
A: Output :-
Q: Write a program in C++ language to print subtraction of array A and B on the screen, these arrays…
A: Output :-
Q: Write a program that first reads an integer for the array size, then reads characters into the…
A: #include<iostream>using namespace std;void Consonant(char x[], int s){ for(int…
Q: Write a C++ program that asks the user to type 10 integers of an array. The program must compute and…
A: In this code, the integers to be entered by user that how many are greater or equal to 10 and the…
Q: Write a program in c++ You have 12 temperatures in your array. You want to calculate the average…
A: C++ code: #include <iostream>using namespace std; // function to return average of arrayfloat…
Q: Write a C++ program to enter the values of a 3x3 array, then print the array and find the largest…
A: Below is the required C++ program. Program Approach: Import standard input-output packages.…
C language and using pointers
Step by step
Solved in 2 steps with 1 images
- Mark the following statements as true or false. A double type is an example of a simple data type. (1) A one-dimensional array is an example of a structured data type. (1) The size of an array is determined at compile time. (1,6) Given the declaration: int list[10]; the statement: list[5] - list[3] * list[2]; updates the content of the fifth component of the array list. (2) If an array index goes out of bounds, the program always terminates in an error. (3) The only aggregate operations allowable on int arrays are the increment and decrement operations. (5) Arrays can be passed as parameters to a function either by value or by reference. (6) A function can return a value of type array. (6) In C++, some aggregate operations are allowed for strings. (11,12,13) The declaration: char name [16] = "John K. Miller"; declares name to be an array of 15 characters because the string "John K. Miller" has only 14 characters. (11) The declaration: char str = "Sunny Day"; declares str to be a string of an unspecified length. (11) As parameters, two-dimensional arrays are passed either by value or by reference. (15,16)1. Write a function called void swap with two parameters, which will receive the addressof x and y as pointer. The function should swap the value of x and y only if x is larger thany. Print the value of x and y after the function call. 2. Write a function called double getAverage(int *array, int SIZE), whereit accept the array as pointer, and return the average of the array. Print the returnedvalue from this function. Always use *array rather than subscript to access the arrayvalue.Write the main program to create an array of size 10. Create two integer variables called max and min. Write a function to accept this array and its size. This function must populate the array with random numbers in the range -400 to 300. Write a different function to accept this array, its size and the address of the two variables max and min. The function must find the max and min of this array and write it to the min and max using pointer notation. Print the array and the values of max and min in the main program. in C++ visual studio
- A pointer variable can contain a pointer to a single variable, a pointer to an array, nullptr, or a random value. Write code that creates and sets four pointer variables a, b, c, and d to show each of these possibilities.Write a program called "pointerArray.cpp" using knowledge of pointer. The program must illustrate the use of a pointer that point to the content of an array and to display the contents of an integer array {5, 10, 15, 20, 25, 30, 35, 40} in order and reverse order. For example the output should be as follows: The numbers in the array are: 5 10 15 20 25 30 35 40 The numbers in reverse order are: 40 35 30 25 20 15 10 5a. Write a statement that declares votes to be pointer of type int. b. Write a C++ code that dynamically creates a two-dimensional array of 50 rows and 10 columns and votes contains the base address of that array. c. Write a C++code that outputs the data stored into the array votes one row per line. d. Write a C++ code that deallocates the memory space occupied by the two-dimensional array to which votes points.
- In C Programming, write a program that creates an array of N names. Each name has 5 exam scores. Output the names with the highest and lowest average scores. No using of Struct, no using of Pointers and No Global Declaration.1. Given the following array declaration: int A [3 ][2 ]={{13, -23}, {3, 80} ,{91,55} }; declare a pointer that points to A[2][0]? Answer:4. Declare an int pointer that points to another pointerAnswer:
- 1. A.Write a program for displaying the string declared in an array, str[] = "hello",in reverse order of characters using pointers. B.Write a program for initializing from another vector that will output 10 20 30Write a program that asks the user to input a series of numbers. Theprogram should read the numbers into an array and then does the following:a) Write a function that will find the average value in the array.b) Write a function that will find the mode value in the array.c) Write a function that will display the sorted array of numbers from maximum tominimum.d) Write a function that will search the array for a specific value.e) Write a function that will display all of this information to the user in a nice format.You should submit the flowchart and the python code for this assignmentProgram In C Write a program to: Read Test 1 and Test 2 marks and store in array test1 and array test2 where each array stores 5 elements. Total up marks from test1 and test2 arrays and store in array named total. Print the total marks from array total. Use pointers to access array members.