what will be the value of the variable A at the end of the loop? int A; for(A=8; A>=3; A -= 2) printf("%d", A); a. 4 O b. 3 C. 2 O d. 1
Q: int a = 10, b =7; System.out.println(a>b?a:b); Will always print what?
A: Coded using Java language.
Q: Student Grade Generator (Toy Problem) Write that prompts the user to input student marks. The input…
A: NOTE: The programming language is not mentioned. So, it is written in Python language. Program…
Q: int main() { } above? int a, b, c, d; 4; JO a b с d 423 22; 32; 42; if(b%a { } 0) if(c%a { } else {…
A:
Q: Use Java programing .Provide Pseudocode and Flowchart .use loop if you need to
A: The, code has given below:
Q: Q2) Answer true or false and correct the answer for the following question. 1- The methods are used…
A: Q2) Answer true or false and correct the answer for the following question. 1. The methods are…
Q: #include int main() { char a = '\012'; printf("%d", a); return 0; }
A: Please find the answer below :
Q: i = 5 while i : print (?, end=',') i=i-1
A: If You Want to Print Numbers in Decreasing Order please use i in place of ? Corrected Code is…
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: The given c program is to calculate the change. This program prompts the user to enter the value…
Q: Complete the following loop in order to display first 5 odd integers. int main() { cout<<"First five…
A: int main() { cout«"First five Odd Integers:"«endl; for( int i=1; i <=10; i=i+2) cout« i «endl;…
Q: Sum of Numbers Write a program that asks the user for a positive integer value. The program should…
A: Here is your solution -
Q: int a = 4, b; b = a-- + 2; What is the value of b in the above code? a. 7 b.
A: Given Code: int a = 4, b;b = a-- + 2;What is the value of b in the above code?
Q: 25. * The last value of A after executing the following code: int A=25; while (A==25) { } A=A/2; 25…
A: Answer:12
Q: String number = “1”; switch ( number ) { case 1: System.out.println( "The number is 1" );…
A: In switch cases, you have used integer. But you have passed String to the switch. So change data…
Q: include int main() { char a = '\012'; printf("%d", a); return 0; }
A: Please find the answer below :
Q: f('A' == 'a' || 'B' > ' printf("AA"); se printf("aa"); printf("BB");
A: Introduction: Below run the c program with ouput C is a procedural and general-purpose…
Q: stoppingDistance = speed * (2.25 + speed / 21) Write a program which determines whether a vehicle’s…
A: Step-1: Start Step-2: Declare variables speed, dist, stoppingDistance Step-3: Take input for speed…
Q: What is the value of y? int y = 5; while (y > 0) { y = y - 1; } System.out.println("y is " + y);…
A: The correct option is (a) y is 0.
Q: #include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number…
A: The function getch() defines under <conio.h> header file, include <conio.h> header file…
Q: Fill the missing code to ensure that the loop repeats 20 times for (int y = 0: Y--) { } //Some…
A: In the given question loop is a sequence of instructions that is continually repeated until a…
Q: Create a program that declares variable to hold number of eggs of a chicken. Your program will…
A: import java.util.*;public class Main { public static void main(String[] args) { Scanner scan =…
Q: #include int main() { char a = '\012'; printf("%d", a); return 0; } Output:
A: Please find the answer below :
Q: Fill the missing code to ensure that the loop repeats 20 times for (int y = 0;__________:y--) { }…
A: In the given question loop is a sequence of instructions that is continually repeated until a…
Q: QUESTION 1 What is i after the following for loop? int y = 0; %3D for (int i = 0; i < 10; ++i) { %3D…
A: int y=0; for(int i=0; i<10;i++){ y+=i; //y=0+1+2+3+4..... 9 } // this loop…
Q: int a = 20 & 4; System.out.println ("a = " + a); display Oa = 4.5 O a = 4 Oa-o Oa- 2
A: Given Java code segment int a=20%4; System.out.println("a ="+a);
Q: 3.Professor Mysterious uses a apecial tormula to calculate the students. Write a program that…
A: I'm writing Python code for this question:
Q: What is the value of x after the following statements are executed
A: Explanation: The switch statement is a multiway branch statement that allows a value to change the…
Q: What is the data type of x after the following assignment: x = 2.0 + 3 - 4 * 12 string…
A: We have been given x = 2.0 + 3 - 4 * 12 we have to describe what is th edata type of the following…
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: The algorithm to calculate the amount of change returned is given below: - Algorithm: - Step1:…
Q: 2- What will the following code do? j=0; i=5; while(j<0) j=j-1; i=i+5;j=i; end
A: Given Code: j= 0;i= 5;while(j<0) j = j-1; i = i+5; j = i;endRequired:Explain what the…
Q: Assume int x-5, y-4; int z= (x<4) ? x++: (--x + (2 y++)): What is the value of z? а. n a. n None of…
A: We are given a programming logic question where we are using ternary operator. In ternary operator…
Q: do{ value += 10; }while(value > 5);
A: Given code snippet: int value = 0; do{ value += 10; }while(value > 5);…
Q: Write an expression that executes the loop while the user enters a number greater than or equal to…
A: Start the program.Declare an integer variable userNum to store the user's input.Prompt the user to…
Q: int m; for (m=20;m>=0;m-=2) { m=m/2-1; printf("%d ",m); }
A:
Q: In Python - Write a program that asks the user to enter two numbers, a low number and a high number.…
A: Introduction: Here we have to write a python program that asks the user to enter two numbers, a low…
Q: What is the value of name after the following steps are executed? float name, x=20.5; float *a = &x;…
A: Here the value of x=20.5 Now *a = &x this means that *a will have the value present at the…
Q: main() { int a = 1, b = 2, c = 3: printf("%d", a + = (a + = 3, 5, a)) } Output…
A: Solution -: Given code is : main() { int a = 1, b = 2, c = 3: printf("%d", a + = (a + =…
Q: include int main() { char a = '\012'; printf("%d", a); return 0; }
A: Please find the answer below :
Q: def f(x: float) -> int: return int(x) def g(x: str) -> float: return float(x) y = f(g("3.14"))…
A: Answer: Option 3 - y's inferred data type is int Explanation: The given equation is y=f(g("3.14"))…
Q: In India McDonald's has the n number of customers and they are famous for their taste and quality so…
A: Given: - The solution as per the given information
Q: ert feet into meters: Write a program which reads the number in feet, converts it to meters, and…
A: Code: #include <iostream>using namespace std;int main(){ float feet, meters,inches;…
Q: 15 var a; 2. a = 89; 97; What will be the value of a after this code runs? a 18 a 93; | 567 H11 1
A: Here is the answer about what will be the value of a.
Q: int input; cout << "enter input " << endl; cin >> input; int…
A: Program: //include the header file #include <iostream> using namespace std; //definition of…
Q: the value
A: The value of the given program
Q: Fill the missing code to ensure that the loop repeats 10 times for (int x = 0;______; x++) { }…
A: above snippet code answer in below step.
Q: Amount = float(input("How much do you weigh?\n")) WaterCalc = 0.08 totalAmount = Amount *…
A: Nothing is appearing because you are not printing anything. So use print statement to print the…
Q: ubtractMe(x): k = x - (2/0) if (k <= 6): return 6
A: Lets see the solution.
Step by step
Solved in 2 steps
- Look at the code below and identify which of the statements below are true: * for loopCounter in range(10,101,10): print(loopCounter) Starts at 1, goes upto 100, increases by 1 Starts at 10, goes upto 101, increases by 10 Starts at 10, goes up to 100, increases by 10 Starts at 10, goes upto 10, increases by 10#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…MUST BE IN PYTHON PROGRAMMING CODE!!!!! NO C++ or Java!! Directions: Design a program with a loop that lets the user enter a series of names (in no particular order). After the final person’s name has been entered, the program should display the name that is first alphabetically and the name that is last alphabetically. For example, if the user enters the names Kristin, Joel, Adam, Beth, Zeb, and Chris, the program would display Adam and Zeb. Additional requirements: Note that the possible set of input values can include negative, 0, or positive values, but not the sentinel value of -99. DESIGN HINT: • When determining the largest (or smallest) value in a set of numbers, remember to use variables to keep track of the current largest (or smallest) number found thus far. These variables can then be used as a comparison to each subsequent input number to see if the new number is larger (or smaller) than the current largest (or smallest) number and updated appropriately. At the end of all…
- Exomple-3: Write a program to calculate the Area and volume for a sphere. Scl. -The area of sphere 4 *PI Radius *Radius. -The Volume of sphere 4/3 PI* Radius Radius "Radius. %3D -Note: Pl 3.14be recor #include #include minutes #include limit on int func(int, int, int, int); main(){ srand(time(NULL)); int a, b, c, fNum; printf("Choose three different numbers between 0-39:"); scanf ("%d%d%d", &a, &b, &c); fNum = func (a, b, c, 25); printf("\nThe result: %d", fNum); } int func (int ul, int u2, int u3, int iter){ srand (time (NULL)); int n1=0, i=0, count=0; for (;iWhat does the following code segment display? for(f=0; f<3; ++f); write ("{0} ", f); a. 0 b. nothing c. 3 d. 0 1 2Sample for Multiple-ifX609: Magic Date A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures out if a user entered date is a magic date. The dates must be between 1 - 31, inclusive and the months between 1 - 12, inclusive. Let the user know whether they entered a magic date. If the input parameters are not valid, return false. Examples: magicDate(6, 10, 60) -> true magicDate(50, 12, 600) –> falseIf integer temperatureCelsius is 37, output "Body temperature". Otherwise, output "Not body temperature". End with a newline. Ex: If the input is 37, then the output is: Body temperature #include <iostream>using namespace std; int main() { int temperatureCelsius; cin >> temperatureCelsius; /* Your code goes here */ return 0;}ii. Coding repeat five times and calculate the sum of the loop counter. while (counter<5) sum=sum+counter; counter++;Question 18 Guessing Game Code a solution for the following problem. Post your program in the textbox below. (NOTE: Indenting matters.) • Hard-code an integer variable valid value from 1 to 10. Ask the user to guess your whole number and input that number. - Then compare the user's input to your literal number ani tell the user how they compare, is it greater than, less than or equal to each other. Extra: Send an error message if the value entered is not between 1 and 10. Edit View Insert Format Tools Table Ev Ev To E v V O Paragraph v BIU A ev T? v 12pt vSEE MORE QUESTIONSRecommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education