Write a program that takes in two integers as inputs and outputs the largest value.
Q: Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print…
A: Program plan: Create a function name printSquare() loop from i=1 to 1000 print(str(i)+". Squared…
Q: Homework: Write a program that calculates y = -x².
A: here is Your Code #include <stdio.h> int main(){ int x=2,y; y=-x*x; printf("y =…
Q: 1- Write a program to find the average of 50 numbers and print the result. 2- Write a program to…
A: program for average of 50 number : #include <iostream> using namespace std; int main() {…
Q: 10. Write a program that computes the sum: 7 k! R = -2 + k
A: code :- import mathvalue = 0.0 def factorialofvalue(n): return 1 if (n==1 or n==0) else n *…
Q: A factorial of N is defined as 1 if N is O or 1, and 1*2**N if N is a non-negative integer. Write a…
A: note:- only one program will be solved if they are not linked . Also mention programming language…
Q: Twin primes are two primes that differ by 2 (e.g., 3 and 5, 101 and 103). Write a ++ program that…
A: Program AlgorithmDeclare the required variables and an array of 1000 elements in main().Then use a…
Q: 1. Write a an algorithm that asks the user to input a positive integer n and counts how many of the…
A: The algorithm is a step-by-step program instruction in a human-readable format. The number of steps…
Q: 4. Write a RANDOM NUMBER GUESSING GAME - • Hard code a random number as answer • Ask user for input…
A: CODE:- #include <iostream> using namespace std; int main() { int…
Q: Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of…
A: #include<iostream> using namespace std; int main(){ int number; cout << "Enter a…
Q: A factorial of N is defined as 1 if N is 0 or 1, and 1*2**N if N is a non-negative integer. Write a…
A: Since the language is not mentioned, we will use C programming by default. We will ask the user to…
Q: 6. Odd to n by Jemar Jude Maranga Write a program that will take as input an integer n and will…
A: The Answer is in given below steps
Q: A positive whole number n > 2 is prime if no number between 2 and n (inclusive) evenly divides n.…
A: import mathn=int(input("Enter n value: "))count=0for i in range(2,int(math.sqrt(n))): if n%i==0:…
Q: Write a program, which: inputs 50 numbers outputs how many of the numbers were > 100 langiage C#
A: #include <stdio.h> int main(){ int x, i, sum=0; x=0; int A[50]; printf("Input 50…
Q: We are given 5 integer numbers. Write a program that checks if the sum of some subset of them is 0.…
A: - We need to highlight the code for subset.
Q: (Compute 7) You can approximate 7 by using the following series: 1 1 1 1 6 x (1 + TT = + + .. . 4 9.…
A: Given:
Q: 4. Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and…
A: the answer along with code and flowchart and output screenshot is given below
Q: Q2) Write a program that prompts the user to enter the number of students and each student's score,…
A: Executable Code: import java.util.*;import java.lang.*;public class Main {// Main Programpublic…
Q: 20.2 LAB: Convert from seconds People find it easier to read time in hours, minutes, and seconds…
A: Given Question: To write a python program.
Q: (Find future dates) Write a program that prompts the user to enter an integer for today's day of the…
A: Python program to find future days from today is given below.
Q: Lab p-4) Write a program that prints the sum of the even numbers and the products of odd numbers on…
A: function main(): Start Declare number, arr[10], i, sum = 0, product = 1 Read number Read integers…
Q: (Summation of a series) Write a program that displays the result of1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9…
A: Since you haven't mentioned the programming language, we are answering this in java. Thank you.…
Q: Q3:- / a: Write a Quick Basic program to compute S value where : S=1+ 1/3+1/5+1/7+ .1/n
A: Use a loop to start from 1 to n with increment of 2 . Set sum=0 Use formula sum=sum+ (1.0/i)…
Q: /** * Given two integers, the second larger than the first, this program: * 1) prints the even…
A: The below given Java program will obey the following rubrics: Importing required data package.…
Q: 1. Write a program that reads in an integer and breaks it into a sequence of individual digits. For…
A: Please find the answer below :
Q: s Write a program to read three numbers and prints the biggest one. طباعة ارقم الأكر من ثلالة ارقام…
A: Question :-
Q: Write a program that asks user to enter a number. Then the program should print the sum of all…
A: Given: Write a program that asks user to enter a number. Then the program should print the sum of…
Q: 1. Write a program that prints your full name. Write a program that prints your full name using…
A: 1.) #include <iostream> using namespace std; int main(){string name;cout<<"Write your…
Q: - Question: Write a program that accepts a set of integer numbers. Your program should count the…
A: 1) infinite loop to read data 2) loop breaks when input is -1 3) Read value is checked to find even…
Q: Find the first 10 square numbers that are greater than Long.MAX_VALUE. A square number is a number…
A: Program: import java.math.BigInteger; public class Main { public static void main(String[] args) {…
Q: A variable like user_num can store a value like an integer. Extend the given program as indicated.…
A: PYTHON CODE:- user_num = int(input('Enter integer:\n')) print ('You entered: ' + str(user_num))…
Q: 2. Write an algorithm (pseudocode) that inputs three positive real numbers x, y, z and outputs the…
A: Psuedo code for positive real numbers as input: input first number(X) input second number(Y) input…
Q: Q5: Write a program that inputs three integers from the keyboard and prints the sum, average,…
A: EXPLANATION - Create a program . Take three numbers as an input frome user named as num1 , num2,…
Q: In Python create a program that reads two positive integers a and b from user and print the…
A: Given: In Python create a program that reads two positive integers a and b from user and print the…
Q: reate a program solving for mean
A:
Q: Find the numbers that can be expressed as the product of two nonnegative integers in succession and…
A: Answer : Script:- #reading the input number fromm user read -p "Enter number: " number #setting…
Q: Write a program that inputs a line of text, replaces all punctuation marks with spaces.
A: Program: //header files #include <iostream> #include <string> using namespace std;…
Q: Q1\Write a program that sums the numbers between 1 and 9 and finds the sum total
A: Here language is not mentioned so i write c code to sum between 1 to 9: (2+3+4+5+6+7+8)…
Q: 4. Sum of Everything by Jemar Jude Maranga Write a program that will repeatedly ask the user to…
A: Program is in step 2. In the program, as you said input should be in series and output is the sum of…
Q: start Get positive integer from user, call it A. Get positive integer from user, call it B. C = A B…
A: According to me correct answer will be Option 4. A**A EXPLANATION answer of flow chart will be in…
Q: Write and test a program that computes the area of a circle
A: The implementation of the program in Python 3 is as follows: SOURCE CODE: PI = 3.14 radius =…
Q: E2.8 Write a program that asks the user for the lengths of the sides of a rectangle. Then print •…
A: As you have not mentioned any specific language so I give the code in Python along with output and…
Q: A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number…
A: 1. Input the number of steps and convert it into int and store it in a variable- noSteps 2.…
Q: Write a program that asks user to enter two numbers. Then the program should print the even numbers…
A: Task : Write a program to print even numbers between two numbers. C++ program :- #include…
Q: ex5 write an algorithm that inputs a n number and Input a number. Add a number to another number.…
A: The algorithm is added below line by line
Q: Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of…
A: Approach To calculate factorial of any non-negative number, we can use either loop (for or while) or…
Q: 8- Write an algorithm (flowchart) to decide whether a number X (3 < X < 22) is a prime or not a…
A: PROGRAM CODE: #include <stdio.h> void main(){ int num,i,ctr=0; printf("Input a…
Q: 2.Write a program that prompts the user to enter a positive integer and obtains its square root in…
A: The program is written in Java. Please find the source code in the next step.
Q: 2. Write a program to calculate time one will take to climb top of statue using stair given, there…
A: C++ code :-
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- #include using namespace std; int main() int x=1,y=2; for (int i=0; i<3; i++) e{ x=x*y; 8{ } cout<#include using namespace std3; int main() { int s-4; int d-s++; cout<#include <iostream>using namespace std; struct Person{ int weight ; int height;}; int main(){ Person fred; Person* ptr = &fred; fred.weight=190; fred.height=70; return 0;} What is a correct way to subtract 5 from fred's weight using the pointer variable 'ptr'?c++complete and change #include <iostream>using namespace std; int sumbyrow(int* m, int ncol, int row){int total = 0;for (int i = 0 i < ncol; i++) {total += m[row * ncol + i];}return total; } int sumBCol(int* m, int nrow, int ncol, int col){int total = 0;for (int j = 0; < j nrow; j++) {total += m[j * ncol + col]; }return total;}int sumBYLeftDiag(int* m, int ncol){int total = 0;for (int i = 0, j = ncol - 1; i < ncol && j >= 0; i++, j--) {total += m[i * ncol + j];}return total;}bool hasDuplicates(int* m, int row) {int flatArray[row * row];int k = 0for (int i = 0; i < row; i++) {for (int j = 0; j < row; j++) {flatArray[k++] = m[i * row + j]; }}for (int i = 0; i < (row * row); i++) {for (int j = i + 1; j < (row * row); j++) {if (flatArray[i] == flatArray[j])return true; }}return flase;} bool isMagicMatrix(int* m, int nrow, int ncol) { if (hasDuplicate(m, nrow), int ncol{return false; }if (sumByleftDiag(m, nrow) != sumByRightDiag(m, nrow)) {return…#include using namespace std3; int main() { int x-6; int y=103; int z=0; int q=1; Z+= X-- -ys q*=++z+y; cout<#include #include #include #include using namespace std; int main (){ const double PI = 3.14159265359; return 0; }#include using namespace std; int main() { int numbers[10]; int i; for (i=0;i>numbers[i]; int numbers2[10],j,k; for(i=0;ic) { max1=rep; c=top; } } cout<#include using namespace std; void some_action_1(int); int main() { cout<#include using namespace std; void myfunction(int num2, int num1); lint main() { my function (5,2); return 0; } void myfunction(int num1, int num2) {if (num1>3) cout << "A1"; else if (num1<3) cout<<"A2"; else cout<<"A3";} O A2 O A1 O A3 A1 A2 A3#include<stdio.h> #include<stdarg.h> void fun1(int num, ...); void fun2(int num, ...); int main() { fun1(1, "Apple", "Boys", "Cats", "Dogs"); fun2(2, 12, 13, 14); return 0; } void fun1(int num, ...) { char *str; va_list ptr; va_start(ptr, num); str = va_arg(ptr, char *); printf("%s ", str); } void fun2(int num, ...) { va_list ptr; va_start(ptr, num); num = va_arg(ptr, int); printf("%d", num); }.C++ program #include <iostream> #include <string> #include<cstring> using namespace std; const int NAME_SIZE = 20; const int STREET_SIZE = 30; const int CITY_SIZE = 20; const int STATE_CODE_SIZE = 3; class Customer { long customerNumber; char name[NAME_SIZE]; char streetAddress_1[STREET_SIZE]; char streetAddress_2[STREET_SIZE]; char city[CITY_SIZE]; char state[STATE_CODE_SIZE]; int zipCode; public: void setCustomerNumber(long customerNo) { customerNumber = customerNo; } bool setName(char name[]) { if (strlen(name) <= NAME_SIZE) { (this->name, name); returntrue; } returnfalse; } bool setStreetAddress_1(char streetAddress_1[]) { if (strlen(streetAddress_1) <= STREET_SIZE) { (this->streetAddress_1, streetAddress_1); returntrue; } returnfalse; } bool setStreetAddress_2(char streetAddress_2[]) { if (strlen(streetAddress_2) <= STREET_SIZE) { (this->streetAddress_2, streetAddress_2); returntrue; } returnfalse; } bool setCity(char city[]) { if…Typedef struct Complex { Double a; Double b; } COMP_t, *COMP; -write function which creates a complex number.The function allocates a complex number, initializes it with given values and returns its address.SEE 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