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
- int sum = 0; for (int i 0; i < 5; i++){ sum += i; } cout << sum;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…Void Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() { Int x = 10; Do1 (x,x); Cout << x << endl; } The output of this program is#include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of salesman(max 20): ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n salesman %d sales: ");scanf("%d", &s[i]);}for(i=0; i<d; i++){for(r=i+1; j<d; r++){if(s[i] > s[r]){p= s[i];s[i] = s[r];s[j] = p;}}}printf("\nsalesman lowest to highest: ");for(i=0; i<d; i++){printf("%d\t", s[i]);}for(i=0;i<m;i++){printf("\n highest sales: %d ",lg);if(lg<=s[i])lg=s[i];break;}getch();} >>> the upper part output should be like this enter number of salesman (max 20): 5 salesman 1 500 salesman 2 300 salesman 3 1000 salesman 4 200 salesman 5 1000 in the lower part the lowest to highest the output should become like this salesman 4 200 salesman 2 300 salesman 1 500 salesman 3 1000 salesman 5 1000 highest total sales : 2000int x1 = 66; int y1 = 39; int d; _asm { } mov EAX, X1; mov EBX, y1; push EAX; push EBX; pop ECX mov d, ECX; What is d in decimal format?What value will be returned by the function if a = 8, b=12? %3D int func(int a, int b){ if(a>b){ return a+b; } else if(aint x; X=-2; do { x++; cout0); cout<<"done"; O done O -2 done O -1 done#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…#include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0; void calculatechange(int* change){if(*change>0){if(*change>=50){*change-=50;cent50++;}else if(*change>=20){*change-=20;cent20++;}else if(*change>=10){*change-=10;cent10++;}else if(*change>=05){*change-=05;cent05++;}calculatechange(change);}}void printchange(){if(cent50)printf("\n50cents:%d coins",cent50);if(cent20)printf("\n20cents:%d coins",cent20);if(cent10)printf("\n10cents:%d coins",cent10);if(cent05)printf("\n05cents:%d coins",cent05);cent50=0;cent20=0;cent10=0;cent05=0;}void takechange(int* change){scanf("%d",change);getchar();}int main(){int change=0;int firstinput=0;while(1){if(!firstinput){printf("\nEnter the amount:");firstinput++;}else{printf("\n\nEnter the amount to continue or Enter -1 to…SEE MORE QUESTIONSRecommended textbooks for youC++ Programming: From Problem Analysis to Program…Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program…Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning