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: In the following code, what is init_()?
A: Question 11: Ans: a method __init__ is a method of class Critter
Q: what does the following code output: float (4)?
A: float(4) convert int value 4 into its float value 4.0
Q: What is the number of execution times of the following program?
A: What is the number of execution times of the following program? label1: MVI B, O INR A loop label1…
Q: What is the output of the following code? between the output) void test ()
A: According to the question we need to find the output for the code: void test() { static int x =…
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 the output of the following code? A = [1,1,2;3,6,9] b = [3, 4] C=A.* b
A: (a) Code will return the error : Matrix dimensions must agree.
Q: a. What is the output of the following code? And why?
A: The given is the java code that will produce the result based on inputs. To generate the output of…
Q: What is the output of the following program
A: The given code is a sample of using inheritance in C#. It has two calles in inheritance as below:…
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: 18 - What is the output of the following code?
A: The output of the following code is - Good Luck good luck
Q: Find out the error of the following code and correct it.
A: The given code is: class Equals{ public static void main(String[] args) { int x = 100;…
Q: What the output for the following code?
A:
Q: What the following program does?
A: START: LDA 2050HMOV B,ALDA 2051HCMP BJC OTHERSTA 2052HJMP ENDOTHER: STA 2053HEND: HLT
Q: Rewrite the following line of code so that it is correct if (name = "Bao")
A: The question asks to correct the statement syntactically.
Q: What is expected to happen when the following code is executed?
A: So, we try to trace the code step by step:- Step 1:- We enter the for loop, take the value a=1.…
Q: what is the output of the following program
A: Program: #include <iostream>using namespace std; int substract(int x ,int y, int z=2 ){ return…
Q: What is the problem in this code?
A: I am not able to see the database, but do check the column names are matching or not. Since there is…
Q: What would be the output of the following program?
A: The given program is:- tt = ['c', 'o', 'r', 'k']tt = ['m', 'a', 'c', 'h', 'i', 'n', 'e'] + tttt[0] =…
Q: What is the data type of the following expressions?
A: Here i am writting data type of given expression:…
Q: What is y after the following switch statement?
A: I have provided C CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT------------------
Q: What is the output of the following * !program
A: A computer program is a collection of instructions that can be executed by a computer to perform a…
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: What is the result of executing the following code?
A: In the given code, the method doTask is overloaded. The first doTask method receives two integer…
Q: What is the output of the following code? Find the output
A: Please find the answer below :
Q: ? What is the output of the following code
A: Required: programming What is the output of the following code? given: #include <iostream>…
Q: 5]
A: Below the output of the following program
Q: What does the following code print out?
A: Step 1:- The given program in the java programming language. Given Program:- public class…
Q: What does the following code output?
A: Given code is- #include <iostream> using namespace std; int main(){ int y = -5, x = -8;…
Q: What would be the output generated by the following code?
A: B. Prints "Welcome To Java" line-by-line for 10 times.
Q: What is wrong in the following code? char* p;cin >> p;
A:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- #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…
- Activity 20 Electric Bill: Using Switch Statement, write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the use is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwhVoid 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 isint j; switch (i) { case 0: j = 2*i; break; case 1: j = -i; break; default: j = -2*i; } What is j if i = 1? What is j if i = -1?
- Activity 20 Electric Bill: Using C Language and Using Switch Statement, Make a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the use is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwhWhat 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 doneLook at the following code. int x = 7; int *ptr = &x;What will be displayed if you send the expression *iptr to cout? What happens if you send the expression ptr to cout?Static Variable: a variable whose lifetime is the lifetime of the program (static int x;) Dynamic Variable: It is a pointer to a variable (int *x;) Is this comparison true?What does the function f do? struct Point2D { double x; double y; struct Triangle { Point2D v1; Point2D v2; Point2D v3; }; void f(Triangle&t) { } int temp = 12.5; temp = t.v1.x; t.v1.x = t.v1.y; t.v1.y = temp; } int main () { Triangle mytri; mytri.v1.x = 1.0; mytri.v1.y = 22.5; f (mytri); Swaps values of x and y in vertex 1 of an argument of type Triangle Initializes value of x in vertex 1 of an argument of type Triangle Sets all x,y values in all vertices of an argument of type Triangle Swaps value of x in vertex 1 with value of x in vertex 2, for an argument of typeSEE MORE QUESTIONS