:Write some statements that display a list of integers from 10 to 20 inclusive ,each with its square root next to it.
Q: What is the output of the following code segment? cout<<get(4,'h',60.8);
A: The first parameter is integer The second parameter character The third parameter is double
Q: 3. Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer.…
A: The Answer is in given below steps
Q: • b-Write a program that prints the block letter "B" in grid of stars like this: ***** * * * * **…
A: Answer: Here is the code: It has not mentioned which language is used .so I used C language to…
Q: What does the variable someVar store at the end of execution? A. It is the number of words in the…
A: Correct Answer will be Option C Explanation: At the end of the execution someVar is going to store…
Q: What will happen when we compile and run the following code? #include using namespace std; int…
A: Please find the answer below :
Q: What are the memory sections for variables in the following code: int *x=new int;…
A: The question is: finding the memory sections for variables in the given code.
Q: What is wrong in the following code? double x = 3.0;int* pX = &x;
A: GIVEN: What is wrong in the following code? double x = 3.0;int* pX = &x;
Q: What will be printed after executing the following C++ code? int a=2, b=4, c=6, d3-5; if (d <= 0)…
A: Given C++ Program: int a = 2, b = 4, c = 6, d = -5; if(d<=0)…
Q: What will the following code display?
A: Given data:- What will the following code display?
Q: Q7: Write a program that reads a collection of car speeds as long as the speeds do not exceed 100…
A: Program Approach: Including necessary header files Using namespace for standard input output…
Q: What is the output of the following code? def test func (*a) : print (a [0]) test func (1,2,3,4)…
A: PYTHON is one of the most widely used programming language currently, many new engineers prefer…
Q: Q1: Write a program that read 10 Marks and print number of failed and succeeded marks.
A: Note: As no programming language is mentioned, therefore answering in python. Input to the Program :…
Q: What is wrong in the following code: double* p1 = new double;double* p2 = p1; *p2 = 5.4; delete…
A: The is nothing wrong in your code but only i see the the error that is you have put the end1 instead…
Q: 7. Write pseudo code that will calculate a running sum. A user will enter numbers that will be added…
A: //Read an integerN = INPUT()//Variable to store running sumRUNNING_SUM = 0//Check if number is…
Q: Display all powers of 2 that are less than 20000. Display the list in a properly formatted manner,…
A: HELLO THERE I AM ADDING ANSWER BELOWPLEASE GO THROUGH IT THANK YOU
Q: 5. The following code has several errors. Find out and circle
A: Errors are circled below
Q: What is the value of i and j after the execution of the following code i = Math.ceil(-2.1); j=…
A: Correct Option is (a) i=-2 and j=3
Q: - What will be the value of M as a result of the following operations? int M; M=33/5; cout<<M; 06,5…
A: We will run this code in a proper C++ program. Then we will get the output.
Q: Q2/ Write a program that prints the block letter “B" in grid of stars like this: ****** * * ****** *…
A: First, middle, last lines have all *'s whereas in other lines, line starts and ends with *
Q: What will be the output of the given code snippet? list = [[2]]*5 print(list)
A: It creates a list of 5 lists and each list has an element 2.
Q: Program which accepts the user's first and last name and print them in reverse order with a space…
A: The Answer is
Q: In C, Given an int variable n that has already been declared, write some code that repeatedly reads…
A: //include the required header file #include <stdio.h> //define main function int main() {…
Q: 1- Write a program that read N of number. Check if number 3 is existing in the numbers read?
A: I give the code in Python along with the output and code screenshot
Q: Q/ Write a program that finds the sum of the odd numbers and the sum of the even numbers among the…
A: I give the code in Python along with output and code screenshot
Q: How many syntax errors in the following code? Assume all libraries are including
A: question 4 There are four syntax errors in the code. the resolved code class…
Q: i. Void search(int * m[],int x) { } void search(int * m, int x) ii. {
A: Given code is 1) Void search (int * m[],int x) { } 2) void search (int*m,int x) { }
Q: What does this code print? Print (2**2**3*2)
A: ** represents exponent and has higher precedence than any other operator These exponents are nested…
Q: baython you have the following code, .choose the correct answer x = [3.0, 5.0, -1.0, 0.0, 3.14] n =…
A: x and n both are variables where x is storing the reference of the list and n is storing the length…
Q: Question 5: Write a program that inputs four strings that represent floating-point values, converts…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C FOR THE SOLUTION Define header…
Q: What is the output of the following code? def test func(*a): print (a[0]) test func(1,2,3,4) test…
A: Actually, python is a easiest programming language.
Q: What is the value of num3 after the following code is executed: int num1; int num2; int num3; num1 =…
A: // Online Java Compiler// Use this editor to write, compile and run your Java code online class…
Q: 5. What is the output of the following code? int count = 0; do cout << count <<""; count++; } while…
A: the output for the above code will be.....
Q: What is the output of the following code? #include void recur (char x) { if(x == 'A') {…
A: Lets see the solution in the next steps
Q: Q1// find the value of x ? # include main () { Int x,y,z ; X=y=z=0
A: Please find the answer below :
Q: What will be the values of the variables a, b and c after executing the following code? int a: int…
A: Answer in step2
Q: QUESTION 2 Write a program that prints out the following pattern **** **** **** ****
A: Required: C++
Q: void main () { int x, у, z; x =10; y = 17; z = x + y; y = y - x; printf ("x: %d, y: %d, z: %d", x,y,…
A: initially, x = 10 and y = 17. so , z = x + y = 10 + 17 = 27. ( z = 27 ) and y = y - x = 17 - 10 =…
Q: Suppose you want to select a random number from the following sequence:0, 5, 10, 15, 20, 25, 30What…
A: randrange
Q: What will be printed after execution of the following code? void main () { int arr[10] =…
A: As we know that according to the initialization of the array elements following values will be…
Q: 3. Given the value of n from the user, write a program that will display the first n even numbers.…
A: The problem is based on the basics of loops in java programming language.
Q: • b-Write a program that prints the block letter “B" in grid of stars like this: * ******
A: The given problem is to be solbed in C++ programming language were the output will be series of *…
Q: Assume you declared int* p, and p’s current value is 100. What is p + 1?
A: Given: Assume you declared int* p, and p’s current value is 100. What is p + 1?
Q: Find errors in code below- #include int main()
A: Given: A C language code is given which reads an integer variable from user and print that number.…
Q: What does the following program segment do? for ( int i = 1; i <= 5; i++ ) { e. for ( int j = 1; j…
A: The inner loop is displaying *4 times and j will be executed 3 times so it will be 3 rows and 4…
Q: Q1:Write some statements that display a list of integers from 10 to 20 inclusive ,each with its…
A: Since you have asked multiple question, we will solve the first question for you. If youwant any…
Q: using namespace int main() { int x = 2; {
A: Introduction: Below the output of the c++ program with screenshot
Q: Q8. What is the output of the following code? def main(): my_list = [[1, 2], [[3], 4], 5]…
A: The given code contains 3-D array list. Answer is 3. As list[0] - it represents first element of the…
Q: Q2- Write a program to read a number (n). Then print all numbers from 0 to n that are not equal to 1…
A: #Note no programming is mentioned so i was used python programming language for i in…
Q: Write a statement that declares a variable words and initialize it to the following list of words:…
A: We need to write a statement that declares a variable words and initialize it to the list of words.…
Q: 1) int main() first 4): f.show): return 0
A: For given c program template, first fix the class declaration. above the main code, so that they can…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Q5: (a) Work out by hand the output of the following script for n=4: n = input( 'Number of terms? '); s = 0; for k = 1:n %3D s = s +1/ (k^ 2); end; disp(sqrt(6 * s)) If you run this script for larger and larger values of n you will find that the output approaches a well-known limit. Can you figure out what it is? (b) Rewrite the script using vectors and array operations. 36 M.sc. Zena Ahmed 2016Q2:Write a single statement to find and display the sum of the successive even integers 2, 4, ..., 200. (Answer: 10 100) Q3:Ten students in a class write a test. The marks are out of 10. All the marks are entered in a MATLAB vector marks. Write a statement to find and display the average mark. Try it on the following marks: 580 10 3 85794 (Answer: 5.9)Exercises: Q1:Write some statements that display a list of integers from 10 to 20 inclusive ,each with its square root next to it. Q2:Write a single statement to find and display the sum of the successive even integers 2, 4,..., 200. (Answer: 10 100) Q3:Ten students in a class write a test. The marks are out of 10. All the marks are entered in a MATLAB vector marks. Write a statement to find and display the average mark. Try it on the following marks: 580 10 3 85794 (Answer: 5.9)
- Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science. anglers have recently gotten back from a fishing excursion. The I-th angler has gotten a fish of weight man-made intelligence. Anglers will flaunt the fish they got to one another. To do as such, they initially pick a request where they show their fish (every angler shows his fish precisely once, in this way, officially, the request for showing fish is a stage of integers from 1 to n). Then, at that point, they show the fish they discovered by the picked request. At the point when an angler shows his fish, he may either become glad, become dismal, or stay content. Assume an angler shows a fish of weight x, and the most extreme load of a formerly shown fish is y (y=0 if that angler is quick to show his fish). Then, at that point: in the event that x≥2y, the angler becomes cheerful; in the event that 2x≤y, the angler becomes miserable; in the event that none of these two…Please complete the following Java program using the math.random function. USE THE Math.random() class. DO NOT use arrays, the Random function. (i.e keep the program simple using while loops, if/else, for loops, etc)Java programming Problem-3 There are two sorted arrays A and B. First one is of size m + n containing m elements and another one is of size n and containing n elements. Merge these two arrays into the first array of size m + n such that the output is sorted. Hints: Trick is to start filling the destination array from the back with the largest elements.
- please type so that i may be able to read it4- Write a program that reads the average of 30 students and find the number of pass students , the number of fail students then print the results. 5- Write a program that reads 20 numbers then find the number of negative and positive numbers and the number of numbers equal to zero and print the results. 6- Write a program to read three numbers A,B,C then find whether A,B,C can form the sides of a triangle, if yes compute the parameter of the triangle , if no print the massage ( not a triangle), then determine whether A,B,C form the side of an (a)) equilateral triangle ,b) isosceles triangie ,c)) right angle triangle Hint: ( A,B,C can form a triangle if each side is less than the sum of the other two sides)def winning_card(cards, trump=None): Playing cards are again represented as tuples of (rank,suit) as in the cardproblems.pylecture example program. In trick taking games such as whist or bridge, four players each play one card from their hand to the trick, committing to their play in clockwise order starting from the player who plays first into the trick. The winner of the trick is determined by the following rules:1. If one or more cards of the trump suit have been played to the trick, the trick is won by the highest ranking trump card, regardless of the other cards played.2. If no trump cards have been played to the trick, the trick is won by the highest card of the suit of the first card played to the trick. Cards of any other suits, regardless of their rank, are powerless to win that trick.3. Ace is the highest card in each suit.Note that the order in which the cards are played to the trick greatly affects the outcome of that trick, since the first card played in the trick…
- [Python Language] Using loops of any kind, lists, or Sets is not allowed. Sloan’s Book Collection Sloan loves reading books. She recently started reading an AI generated series called “Harry Trotter”. Sloan is collecting books from the series at her nearest bookstore. Since the series is AI generated, the publishers have produced an infinite collection of the books where each book is identified by a unique integer. The bookstore has exactly one copy of each book. Sloan wants to buy the books in the range [l,r], where l ≤ r. As an example, the range [−3,3] means that Sloan wants to buy the books − 3, − 2, − 1, 0, 1, 2, and 3. Pam also loves the series (or maybe annoying Sloan– who knows, really), and he manages to sneak into the bookstore very early to buy all of the books in the range [d,u], where d ≤ u. When Sloan later visits, sadly she will not find those books there anymore. For example, if Sloan tries to buy books [−2,3] and Pam has bought books [0,2], Sloan would only receive…Three numbersa. Write a program that reads three numbers and prints “all the same” if they are allthe same, “all different” if they are all different, and “neither” otherwise.b. Write a program that reads three numbers and prints “increasing” if they are inincreasing order, “decreasing” if they are in decreasing order, and “neither”otherwise. Here, “increasing” means “strictly increasing”, with each value largerthan its predecessor. The sequence 3 4 4 would not be considered increasing.c. Repeat part b. but before reading the numbers, ask the user whetherincreasing/decreasing should be “strict” or “lenient”. In lenient mode, thesequence 3 4 4 is increasing and the sequence 4 4 4 is both increasing anddecreasingX15: inOrder Write a function in Java that implements the following logic: Given three ints, a, b , and c,return true if b is greater than a, and c is greater than b.However, with the exception that if bok is true, b does not need to be greater than a.