What is the output of the :following code
Q: What is the output of the * ?following program
A: Explanation: In the given code, the value of “t” is 11. So, the execution jumps to “case 11”. In…
Q: What is the output of above code.
A: Given: Two Class A and B, in which Class B is derived from Class A. Class B is derived class here.…
Q: What is the output of the following code? int x = 0; void main()
A: Here have to determine correct option for given c code and gives correct output option.
Q: What is the output of the following segment of code if the value 6 is input by the user when asked…
A: Entered number = 6. so, num = 6 and total = 0. inside switch case case 1:, case 2:, case 3:,…
Q: What is wrong in the following code? int x; int* const p = &x; int y; p = &y;
A: EXPLANATION - Firstly the pointer is declared constant . Then it is also initialized with address…
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 is value of ans after the following code is executed? >> 5 * 5; ; >> ans +
A: ans in matlab is used store the values of the operation. It is a default varible to store the result…
Q: Find the error in the following code and explain how to fix it:
A: The error in the code is in the line : ptr=m; Because ptr is a pointer variable and we cannot assign…
Q: What is wrong in the following code? int x; const int* p = &x; int y; p = &y; *p = 5;
A: given snippet : int x; const int* p = &x; int y; p = &y; *p = 5;
Q: Analyze the following code and choose the correct statement(s) about the following code (Choose all…
A: The this keyword refers to the current object in a method constructor. The most common use of the…
Q: please write a code for that
A: Since the programming language is not mentioned, I have coded above question Python. Follow the…
Q: What is the output of the ?following program
A: Explanation: Given, “k=5” and “f=9”. The condition “if(f<=k)” fails because, “k” is greater than…
Q: I need to write the following code taking entera from the user.
A: The answer to thee following question:-
Q: Complete the code as below mentioned. Write all
A: Here, in this question, we are asked to develop a GO code. It is stated that the amount of potatoes…
Q: What is wrong in the following code?if score >= 60.0:grade = 'D'elif score >= 70.0:grade =…
A: Define variable score that will take the user input for the score. Use if condition to check if…
Q: What is the value assigned to x after the following C expression is executed? int a=1, b=5, x; x=…
A: Please find the answer below
Q: What is the purpose of the following statement?
A: A purpose statement, also known as a "position statement," is a sentence that outlines a company's…
Q: What is the output of the following int main()
A: Q
Q: What will be the output for a and b given the below code segment?
A: given: c++ code required: to run the code and provide output and value of a and b.
Q: 8- Evaluate the following code (5 > 6 || 4> 3) && (7>8)
A: The logical operators are the operators that are used to combine two expressions.
Q: Find the error in the following code
A: Please upvote. I am providing you the correct answer. You can never, in no context, change an…
Q: What is wrong in the following code: double d = 5.4;double* p1 = d;
A: Given Code:- double d = 5.4;double* p1 = d;
Q: What is the output of the following code snippet? int i = 0;
A: While doing programming in any programming language, you need to use various variables to store…
Q: What is the value of n3 after the following code is executed:
A: The correct answer is: 14 Here is the explanation: Code Result Explanation: int n1 = 2;…
Q: What will be the output of given code.
A: In the given code a char variable ch is initialised with value 'A'. Then in output &ch is…
Q: What is the Pre-Fix expression for the following infix expression? ((A+B)*C-(D-E))&(F+G)
A: What is the Pre-fix Expression of Infix Expression ((A+B)*C-(D-E))&(F+G)
Q: is the output of the following code listing.
A: The method add(Element e) appends e to the end of the list. The method add(int index, Element e)…
Q: What is the value stored at variable "x" after executing the following code segment
A: Please find the answer below :
Q: What is the output of the following code segment? s=1; while(s < 4) ++s; Write("{0} ", s); a. 1…
A: while (<condition>) statement-1; statement-2; statement-1 comes inside while loop…
Q: QUESTION 2 Write a program that prints out the following pattern **** **** **** ****
A: Required: C++
Q: What is the output of the following code? A=[12 3]; A.^2 *
A: given code: A = [1,2,3];A = A.^2 required: to give the output of the program.
Q: What is the output of this code
A: In this question, a code segment is given and we are asked to give the correct output Given Code:
Q: What will be the output of code given below.
A: In the given code we are given : Integer variable n = 10. Pointer to integer variable m, which…
Q: Question 1: Give the output from the following pieces of code: Code Output
A: Question given (1): Some piece of code given, what is the output of them. Solution (1):…
Q: Find the output of the following code.
A: Step 1:- Explanation:- 1.Declare and Initialization of variable int c1=5,c2=4,c3=3; 2.call the…
Q: ? What is the output of the following code
A: Required: programming What is the output of the following code? given: #include <iostream>…
Q: h. ne Write the main function to do the following a. Return type int
A: 5) #include<stdio.h> //header files #include<conio.h> #include<stdlib.h>…
Q: What is the output of the following code #include void recur(char x){ if(x == 'A') { printf("&c",…
A: Language is one of the most widely used programming language which has been used to create different…
Q: What is wrong in the following code: double* p1;p1* = 5.4;
A: Given Code:- double* p1;p1* = 5.4;
Q: What is the output of the following code if grade=76?
A: given simple if else conditions, answer for given condtition is below with explanation
Q: Can you please break the above code into 3 sections (loan.h, loan.cpp and main.cpp and give me the…
A: Please refer to the following steps for the complete solution to the problem above.
Q: Given the following code what will be the output?
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: What is the output of the following cod
A: Required: provide the output of the following code ?
Step by step
Solved in 2 steps with 1 images
- Number guessing Game Write a C program that implements the “guess my number” game. The computer chooses a random number using the following random generator function srand(time(NULL)); int r = rand() % 100 + 1; that creates a random number between 1 and 100 and puts it in the variable r. (Note that you have to include <time.h>) Then it asks the user to make a guess. Each time the user makes a guess, the program tells the user if the entered number is larger or smaller than its number. The user then keeps guessing till he/she finds the number. If the user doesn’t find the number after 10 guesses, a proper game over message will be shown and the actual guess is revealed. If the user makes a correct guess in its allowed 10 guesses, then a proper message will be shown and the number of guesses the user made to get the correct answer is also printed. After each correct guess or game over, the user decides to play again or quit and based on the user choice, the computer will make…int input; cout << "enter input " << endl; cin >> input; int i = input / 2; int d; for (i >= 2; i--;) { d = input % i; if (d == 2 || i == 1) cout << "not prime" << endl; else cout << "prime" << endl; } This code outputs prime numbers as both "prime" and "not prime" but I just want it to say "prime". Please help me with this problem using c++.A prime number is called a Mersenne prime if it can be writtenin the form 2p - 1 for some positive integer p. Write a program that findsall Mersenne primes with p ≤100 and displays the output as shown below.(Hint: You have to use BigInteger to store the number because it is too big tobe stored in long. Your program may take several hours to run.) p 2^p – 1---------------------2 33 75 31...
- First, read in an input value for variable valCount. Then, read valCount integers from input and output each on the same line wrapped in curly braces. End with a newline. Ex: If the input is 3 75 -25 -55, the output is: {75}{-25}{-55} #include <iostream>using namespace std; int main() { int valCount; cin >> valCount; int inputNum; for (int i = 0; i < valCount; i++) { cin >> inputNum; cout << "{" << inputNum << "}" << endl; } return 0;} Input 3 75 -25 -55 Your output {75} {-25} {-55} Expected output {75}{-25}{-55} check2: Compare outputkeyboard_arrow_up Input 1 70 Your output {70} clear3: Compare outputkeyboard_arrow_up Output is nearly correct, but whitespace differs. See highlights below. Special character legend Input 4 15 40 50 10 Your output {15} {40} {50} {10} Expected output {15}{40}{50}{10} clear4: Compare outputkeyboard_arrow_up Output is nearly correct, but…A polynomial is given by f=(8.5×v×v)−(7.0×v)+3.5. Declare double variables v and f. Then, read v from input and compute f using the polynomial. Ex: If the input is 1.0, then the output is: 5.000 #include <iomanip>#include <cmath>#include <iostream>using namespace std; int main() { /* Your code goes here */ cout << fixed << setprecision(3) << f << endl; return 0;}(Rounding Numbers) An application of function floor is rounding a value to the nearestinteger. The statementy = floor(x + .5);will round the number x to the nearest integer and assign the result to y. Write a program that readsseveral numbers and uses the preceding statement to round each of these numbers to the nearestinteger. For each number processed, print both the original number and the rounded number.
- Net Salary Calculator (Toy Problem)Write a program whose major task is to calculate an individual’s Net Salary by getting the inputs of basic salary and benefits. Calculate the payee (i.e. Tax), NHIFDeductions, NSSFDeductions, gross salary, and net salary.Programming Exercise 10 in Chapter 6 asks you find the mean and standard deviation of five numbers. Extend this programming exercise to find the mean and standard deviation of up to 100 numbers. Suppose that the mean (average) of n numbers x1, x2, . . ., xn is x. Then the standard deviation of these numbers is:S=sqrt(((x1-x)^2+(x2-x)^2+...+(xi-x)^2+...+(xn-x)^2)/n)"Sales Commissions. You were hired in a store to implement a program that computes sales commission for all employees. The commission is computed as follows:\n", "| Sales amount | Commission rate |\n", "|--------------|-----------------|\n", "| 0 up to 5,000| 8 percent |\n", "|5,0001 to 10,000| 10 percent |\n", "| above 10,0001 | 12 percent |\n", "\n", Notice that if a sales person makes, say 12,500 on sales, this person receives 8 percent over the first 5,000, plus 10 percent over the second 5,000 and 12 percent over the 2,500. The input for this program is the amount of sales for one sales person entered using the keyboard. Test your code with 12,500 the answer should be 1,200 dollars."
- in Python please. You buy an international calling card to India. The calling card company has some special offers. If you charge your card with $15 or $20, you don't get anything extra. For a $35 charge, you get $6 of extra phone time. For a $60 charge, you get $7 of extra phone time. For a $120 charge, you get $15 of extra phone time. Write a function that asks the user for the amount he/she wants on the card and returns the total charge that the user gets. Note: Values other than those mentioned earlier are not allowed. Include appropriate comments to make your code more readable.please code in java.. dont use very advanced coding Double variable numFeet is read from input. Type cast numFeet to an integer.Ex. If the input is 52.5, then the output is:52in this code, the integer on each line shows the line number that is not part of code: write line where a call to sum takes place: ____ 1 public static int sum(int x, int y){ 2 int z = x +y; 3 return z; 4 } 5 public static void main(String[] args){ 6 … 7 sum(a+2, b); 8 … 9 }