Suppose the input is 2 3 4 5 0. What is the output of the following code? #include <iostream>using namespace std; int main(){int number, max; cin >> number; max = number;do{cin >> number;if (number > max) max = number; } while (number != 0);cout << "max is " << max << end1; cout << "number " << number << end1;return 0; }
Q: Write a program in C that accepts: 1. the radius of a sphere in a variable say radius, 2. The choice…
A: Given: C program to perform the following: Accept input radius of the sphere from the user. Scan…
Q: What will the following programs print on the screen? A) #include <iostream>using namespace…
A: A) OUTPUT: 0…
Q: Consider the following C++ code and fill the blanks: string name, phrase; cout>name; //What…
A: a) Please enter your full name: Bartleby Bartleby loves holidays!
Q: Consider the following code. NOT_Assigned [5, 0, 2, 4, 6, 3, 1] num = alist = val = 0 for i in…
A: Given code: num=?alist=[5,0,2,4,6,3,1]val=0 for i in range(0,num): val=alist[alist[val]]…
Q: 1. Write output of the following C code? #include #include int main() { struct tm *ptr; time_t t;…
A: Given, Code: #include<stdio.h> #include<time.h> int main() { struct tm *ptr;…
Q: What will be the output of the following C++ code? #include #include using…
A: Question. What will be the output of the following C++ code? #include <iomanip>…
Q: What is the output of the following program? #include <iostream> using namespace std; int…
A: PROGRAM CODE: #include <iostream> using namespace std; int main(){int x = 50, y = 60, z =…
Q: Explain the code below. #include using namespace std; string USERNAME[20]…
A: The given program is a banking program. In this program, the user is asked whether they want to log…
Q: Loco Burrito has hired you to develop a new food ordering system for its customers. Each customer…
A: Code in next step
Q: A student wrote the following function to find the minimum and maximum number between two values a…
A: Answer: A student wrote the following function to find the minimum and maximum number between two…
Q: hat will be the output of the following program in C++? #include using namespace std; int main () {…
A: Required: What will be the output of the following program in C++? #include<iostream> using…
Q: 9. What will be the output of the following C++ code? #include using namespace std;…
A: Question 9. What will be the output of the following C++ code? #include <iostream>…
Q: 5.A)For the code segment below, what should be the values for q will result in kiwi being included…
A: A switch case is like a if-else-if ladder. When the value of variable to be switched matches any…
Q: consider the following code * #include using namespace std; int main() { double wages, hours,…
A: If the working hours is between 1 to 40 then, totalWages = (rate * hours) If the working hours is…
Q: What will be the output of the following C++ code? #include using namespace std; int main() { int…
A: Given, Code is given in C++ language. Code: #include <iostream> using namespace std; int…
Q: What is the output of the following code segment? Assume user input is: soccer football void…
A: Task :- identify the output for given C++ code.
Q: A) Create an application in C# to collect all the following marks out of 100 and then calculate your…
A: According to the information given:- We have to create an application in c# on the basis of…
Q: Please answer as soon as you can. What will be the output of the following C++ code?…
A: Given, Code: #include <iostream> using namespace std; main() { double a = 21.09399;…
Q: #include using namespace std; int main() { double hours, pay, gross, regular, OT, OT1; cout…
A: 1) You program had some issue in if else if statements. It is updated such that First if condition…
Q: 1. Write a program that calculates the user's body mass index (BMI) and categorizes it as…
A:
Q: Find and Correct Errors and print output #include using namespace std; int fun(int a, char…
A: Please upvote for my efforts. !. ANSWER code: #include<iostream>using namespace std; void…
Q: Assume there is a variable, h that has already been assigned a positive integer value. Write the…
A: In step 2, you will get python code. In step 3, you can see the sample output.
Q: 9- The script in the left side is used to solve the right-side equation. * #include #include using…
A: Given: A C++ program is given and an equation is given. Requirement: Choose whether the given code…
Q: Suppose the input is 2 3 4 5 0. What is the output of the following code? #include…
A: Program code with detailed comment: //including necessary header files #include <iostream>…
Q: // Program 4.9.1 #include using namespace std; int main( ) { char str[80]; cout= 'A' && str[i]…
A: #include<iostream>using namespace std; //This is just the header file for the program //this…
Q: The following program asks the user to enter two numbers. What is the output of the program if the…
A: When using endl in the program you have written end1 instead of endl. Here is your correct program.…
Q: Here are my C++ program instructions Write a program that prompts the user to enter a positive…
A: Since you have not given the complete criteria as mentioned in the question, we have analyzed your…
Q: This C program handles values only up to $99.99. Please modify to handle values up to $999.99.…
A: To handle values up to $999.99, you need to write more code for calculation. Like you have done for…
Q: The result of the program is #include void main( ) { int x, y, z; x=10; y=5; z-0;…
A: Here, I have to choose an option for the given question.
Q: ? What is(are) the Syntax error(s) in the following code #include using namespace std ; int main( )…
A: #include <iostream>using namespace std;int main(){ int y=6,z=0; int x=5,w=3; const n…
Q: Study the following code segment and identify the line that will cause a syntax err void Secret…
A: Syntax errror - It is a error occurs in the source code of program.It can be syntax error or…
Q: What will be the output of the following C++ code? #include using namespace std;…
A: Question. What will be the output of the following C++ code? #include <iostream>…
Q: 9- The script in the left side is used to solve the right-side equation. #include #include using…
A:
Q: A student wrote the following function to find the minimum and maximum number between two values a…
A: #include <iostream>using namespace std; void minMax(double a, double b, double &min,…
Q: Find errors in the following lines of code assuming included header files. Write correct form with…
A: syntax errors: The programming language has a convention to follow the rules of the programming…
Q: Suppose the input is 2 3 4 5 0. What is the output of the following code? #include…
A: In the given code there are some errors in endl but I have fixed them and the code is running…
Q: complete magic Square #include using namespace std; /*int f( int x, int y, int* p, int* q ) { if…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: Correct the code by using the global variable to move the calculations such as (downPayment =…
A: I am considering that all the other code is correct only the thing you needed is the adding code for…
Q: The following program asks the user to enter two numbers. What is the output of the program if the…
A: The output of the program is explained by tracing the program execution:execution starting from main…
Q: e C++ code below #include using namespace std; int main () { int first_opt, area_opt,…
A: The question is to draw the flowchart of the given program.
Q: Suppose you want to track the execution time of a code snippet in your program. Which of the…
A: Task : Choose the correct option for given question.
Q: What will the following program display? #include using namespace std; int main() { int a = 0, b =…
A: Relational operators: Relational operators that compare the two values or expressions comparing the…
Q: What will be the output of the following C++ code? #include using namespace std; int main()…
A: const keyword in c++ fix the value of variable in program.
Q: 1-Suppose x and y are int variables and z is a double variable. Assume the following input da 37…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: . What will be the output of the following C++ code? #include using namespace std;…
A: Question 10. What will be the output of the following C++ code? #include <iostream> using…
Q: . Create a flowchart for he C++ program below: include sing namespace std; nt main() int menucode,…
A: Firstly , initialization statement and data is stored, int menu code, nooforder; string name;…
Q: What will be the output of code given below. #include using namespace std; int main() { int n=12;…
A: In given code a loop is there which runs until value of n is not zero. Since initial value of n is…
Q: Modify the craps program to allow wagering inside of C#. Initialize variable Balance to 1000…
A: Solution:: package april.april16; import java.util.Random; import java.util.Scanner; public…
Q: The following C++ code segment in main function shows in Figure Q1(b)(i) is incomplete. Add all…
A: The given code is: int main(){ Bmi index; double Sweight, Sheight; cout << "Enter…
Q: b) #include 27.0 #includeciostream> using namespace std; void main(){ int x = 2; int y = 5; ? cout…
A: Question 1: part a: code: #include<iostream>using namespace std;int main() {…
Suppose the input is 2 3 4 5 0. What is the output of the following code?
#include <iostream>
using namespace std; int main()
{
int number, max;
cin >> number;
max = number;
do
{
cin >> number;
if (number > max)
max = number;
} while (number != 0);
cout << "max is " << max << end1;
cout << "number " << number << end1;
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Use C++ #include <iostream> using namespace std; void fillArray(int[], int); void printArray(int[], int); int main() { const int N = 10; int A[N] = { 0 }; srand(time(NULL)); fillArray(A, 10); printArray(A, 10); return 0; } void fillArray(int A[], int size) { // complete the code } void printArray(int A[], int size) { // complete the code }what will the following valid C++ code display in the console window? Show your work. #include <iostream> using namespace std; int zoo(int j, int &y); //prototype int main() { int j = 3, k = 4; cout << zoo(j, k) << endl; cout << j << " " << k << endl; return 0; } int zoo(int j, int &y) { int foo = 3; for (int i = 0; i < j; i++) foo += i; j = foo; y = foo; return foo; }9. What will be the output of the following C++ code? #include <iostream> using namespace std; enum cat { temp = 7 }; int main() { int age = 14; age /= temp; cout << "If you were cat, you would be " << age << endl; return 0; }
- 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…int main() { E(); C(); E(); } void B() {...} void C() {..} void D() {..} void E() { B(); D(); } A variable declared in function B and only in function B is accessible in?C++: Describe how the following call by reference works. Make a comment for each line. void pxc(int& c, int& d) { int k = c; c = d; d = k; } int main() { int a = 15, b = 100; pxc(a, b); }
- Given the code below: type point real a, b end type type (point) v read*, v z=v%a/v%b print*, z end What is the equivalent code for the above statements? Question 6 options: none of the given code choices type point real a, b end type type (point), dimension(2):: v read*, v do i=1, 2 z=v(i)%a/v(i)%b end do print*, z end all the given code choices type point real a, b end type type (point), dimension(2):: v read*, v where (i>0) z=v(i)%a/v(i)%b end where print*, z end real va, vb read*, va, vb z=va/vb print*, z endWhat will be the output of code given below. #include <iostream>using namespace std;int main(){int i=10, j=7;cout<<i%j; return 0;}What will be the output of the following C++ code? #include <iostream>using namespace std;enum cat {temp = 7};int main(){int age = 14;age /= temp;cout << "If you were cat, you would be " << age << endl;return 0;}a) If you were cat, you would be 5b) If you were cat, you would be 2c) If you were cat, you would be 7d) If you were cat, you would be 9
- In C++, write a program that calculates and prints a monthly paycheck for an employee. The net pay is calculated after taking the following deductions from the employee's gross salary: Federal Income Tax: 17.5% State Tax: 9.1% Social Security Tax: 6.2% Medicare Tax: 1.45% Retirement Plan: 9.29% Health Insurance: $51.48 Life Insurance: $3.71 Your program will prompt the user to input the employee ID, the employee name, and the employee's monthly gross salary. The program will calculate the deductions listed above, along with the percentage of take home pay (defined as the net pay divided by the gross salary). After calculating each deduction and percentage, the output will be printed to the screen (see example output below). Requirements All decimal numbers must be formatted to 2 decimal places. Ask for the employee's ID first, then full name (can include spaces), then the salary. The prompt to enter the salary must include the employee name. The employee ID MUST be…I am needing assistance with the following program build in C++. To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number meaningful, companies might use more than seven letters. For example, 225-5466 can be displayed as CALL HOME, which uses eight letters. Write a program that prompts the user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits. If the user enters more than seven letters, then process only the first seven letters. Also output the – (hyphen) after the third digit. Allow the user to use both uppercase and lowercase letters as well as spaces between words. Moreover, your program should process as many telephone numbers as the user wants.What will be the output of given code. #include<iostream>using namespace std; int add(int a,int b){return (a+b);}int main(){int a=5,b=3;cout<<add(a,b)<<endl;}