a=6 b=5 c=((a**2)+(b**3))//(a*b) print(c) What is the output of the above program
Q: Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368…
A: The steps of the program are: Take input for the variables age, weight, heart_rate, time using the…
Q: Write a program to display the odd numbers which are divisble by 3 also in range given by user. Do…
A: Program Approach - Use the essential header files as per code requirements. Define the function…
Q: Take the input numbers from user and find sum of all those input numbers until user inputs negative…
A: EXPLANATION - Declare a variable n . Initialize with value 0 . Declare a variable sum . Initialize…
Q: 2- Write a program to check a given integer number if it is divisible by 7 or not. 3- Write program…
A: 2, c++ program to fing the program is divisble by 7 : // A Program to check whether a number is…
Q: Lab p-1) Write a program that calculates the following math equation: |axb e a=30, b=23, c=13
A: 1)calculate first d=a*b 2)next calculate d/c into e 3)calculate f into square root of e using…
Q: 9. Write a program that will display the following pattern, given the vaiue of n. Example: If n = 4,…
A: pattern program code in c program with output is present in step 2.
Q: c++ Given two sequences with n integers between 0 and 9, interpreted as two n-digit integers,…
A:
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: Write a program that input numbers from the user until user press “E”. Program should display total…
A: Use int to store input number and char to store the choice to exit
Q: Question 1: Write a C program that do the following: A Ask the user to enter his grade as (A, B, C,…
A: Below is the required code in C language. Approach to Program: Include necessary header files to…
Q: Q1: Write a program that determines whether the input year is Leap or Simple, Where the leap year is…
A: //Program of leap year #include <stdio.h>int main() { int y; printf("Enter a year: ");…
Q: Read A Read B Read C IF ((A+B+C> 20 && A-B 15 || B< 15) && C<14) THEN Print "A Large" ENDIF
A: Frances E. Allen was the first to create the control flow graph. The graphical illustration of…
Q: Program Set 3 Write a C Program that asks the user to enter a US dollar amount and then show how to…
A: Given :
Q: Write a single statement to print: user_word,user_number. Note that there is no space between the…
A: Given,A variable named user_word to store a word entered by the user.A variable named user_number to…
Q: Ex Write C++ code that print the umbers between 1 to 100 that dividable by 3 in vertical line, then…
A: //program to print the numbers between 1 to 100 that dividable by 3 in a vertical line, then print…
Q: F. Write a program that will display the following pattern, given the value of n and m. Example if n…
A: Here I have taken input from the user for the value of m and n. Next, I have used for loop to…
Q: · Exercise # 1: Wite a program that determines the day number (1 to 366) in a year for a date that…
A: Here, we have to write programs for the above programs.
Q: Write a code that prints the Fibonacci series backwards. Prompt for and input two integers in the…
A: #include <stdio.h> int main() { printf("Enter two numbers in fibonacci series:"); int…
Q: Write a program that will display the following pattern, given the value of n. Example: If n = 5,…
A: Program Explanation :- According to the question Pattern are designs / symbols that include…
Q: C++ Write a program to take input from user . The input must be integer. Check this number is prime…
A: Given: To Write a program in C++ to take input from user . The input must be integer. Check this…
Q: Write a program to check whether the given number is even or odd.
A: NOTE : As the question is not specific about the programming language to be used to write the code ,…
Q: Q2/ Answer A or B: the factorial of a non-negative integer is expressed as (1x2x3x...) xn n! = 1…
A: As per guidelines we are supposed to answer only one question. Kindly repost other questions as a…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: Program code: //include the required header file #include <iostream> #include…
Q: 1. Write the program and find the error(s) for each the following statements: a. Assume: int a[5]:…
A: For both parts , I have provided C CODE and CODE SCREENSHOT WITH OUTPUT------
Q: (Count positive and negative numbers and compute the average of numbers) Write a program that reads…
A: The C++ program is written where it takes the input from the user and counts the positive and…
Q: 1. Write a program that reads two integer numbers and determines and prints if the first is a…
A: Check the remainder on dividing the first number with second number and if remainder is 0 then the…
Q: 16. Write a program that will display the following pattern, given the value of n and m. Example if…
A: We have to write a C program to print the pattern as given. Here n (number of columns) and m (number…
Q: 6. Write a program that reads four integers from the user and outputs the largest and second-…
A: code : - // import Scanner class to get the user input import java.util.*; public class Main{…
Q: Write C ++ program, to read A (n, n) of numbers, then put 5 instead each odd positive number.
A: Required: Write C ++ program, to read A (n, n) of numbers, then put 5 instead each odd positive…
Q: Analyze the following statements and predict the output. Each statement is assumed the continuation…
A: The solution to the given problem is below.
Q: 2. Write a program to input a number x from the keyboard. If the number is larger than 0, find its…
A: The problem is based on finding the square or square root of a number depending on its value.
Q: Write a program that converts the angle from degree to radian and displays each value.
A: "Since you have asked multiple question,we will solve the first question for you.If you want any…
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: 3- The below program has errors, trace the below program and mention the errors: # include int main…
A: - We have to correct the code removing the errors.
Q: Write a program that reads an integer and uses a single variable to add 5 to the integer, multiply…
A: Given :- Write a program that reads an integer and uses a single variable to add 5 to the integer,…
Q: Using C++ Write a program to output the sum of the first 50 prime numbers. Your output should…
A: The program is written in c++
Q: c=a+b d=a+b+c print(c) print(d) What is answer for the statement print(c)
A: given: a=47,b=78 a=a+b b=a+b c= a+b d=a+b+c print(c) print(d) What is answer for the statement…
Q: 2-Write a program which will read in three integers and will output the sum and average of the…
A: Program Plan: Input 3 integers from the user. Calculate the sum and average of the numbers.…
Q: 2.16 LAB: Convert to seconds Write a program that reads in hours, minutes and seconds as input, and…
A: For completing this program, we will follow the subsequent steps: Initializing the Scanner class…
Q: 14. Write a program that will display the following pattern, given the value of n. Example: If n =…
A: Write a program that will print the following pattern: n = 41234 123 12 1
Q: 1. Write a program that does the following: - reads an unspecified number of integers - determines…
A: Question -1 #include<stdio.h>int main(){ int a[1000],i=0,count=1,pos=0,neg=0,k=0; float…
Q: 1. Write a program that takes a two digit number and prints the number backwards.
A: As per the rules of Bartleby i can only solve 1 question at a time if they are not interrelated so…
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: 5. Write the python code which selects a random number between 1 and 10, once. Prompt the user for…
A: 5.) We have to guess a random number between 1 to 10. For this, we have imported a random package…
Q: 13. Write a program that will display the following pattern, given the Example: If n = 4, output…
A: codE: #include <iostream> using namespace std; int main(){ int i, j, rows; printf("Enter…
Q: 3. Write a code that accepts any number and compute the sum from 1 to the Nth number. If the user…
A: #include <iostream>using namespace std; int main(){ int n; cout<<"Enter a…
Q: Q1: Write a c++ program to enter number and test it, if the value of the number less than 20 print "…
A: Code: #include <iostream>using namespace std;int main(){ int num;//declaring integer…
Q: a=5 b=10 b=a+5 while a==b and b<=a: print("NCT") print(a) The output of the above program will be
A: the output of the following code will be: 5
Q: Point out the errors if any in the following part of the program in c++ void main() { int…
A: void main() { int a=30; f(); // function call } void f() //function definition { int b=10;…
Q: 5.32 (Guess the Number) Write a C program that plays the guess the number" as fol- game of “ lows:…
A: The c program is written where it is random guess number within a specific range here it is 1 to…
Step by step
Solved in 2 steps with 2 images
- Q5: (Count positive and negative numbers and compute the average of numbers) Write a program of C++ that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run: Enter an integer, the input ends if it is 0: 1 2 -1 3 0 The number of positives is 3 The number of negatives is 1 The total is 5.0 The average is 1.25(Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point numbers with random numbers that have been scaled to the range 1 to 100. Then determine and display the number of random numbers having values between 1 and 50 and the number having values greater than 50. What do you expect the output counts to be?C++input a positive integer,output binaryuse loopcan't use recursive or other function example: n = 5 output 101 n = 15 output 1011
- Given the following program segment: int first = 3; int second = 4; int j; for ( j = 1; j <= first; j++) { cout << second * j <<endl; second= second + (j - 1); } cout << endl; Your task is to write a while loop and a do ... while loop which will produce the same output.C++ What does the following segment of code output to the screen (be precise)? int a = 3; if (a % 2) cout << "* * * * * * * *\n" ; cout << "* * * * \n"; a = 4; if (a % 2) cout << "* * * * * * * *\n"; cout << "* * * *\n";Solve the problem with C++ (Count positive and negative numbers and compute the average of numbers)Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number.If you entire input is 0, display 'No numbers are entered except 0.'Sample Run 1Enter an integer, the input ends if it is 0: 1 2 -1 3 0The number of positives is 3The number of negatives is 1The total is 5The average is 1.25Sample Run 2Enter an integer, the input ends if it is 0: 0No numbers are entered except 0
- Q2. Write a Program to that will take input from the user and tells if the user entered Even or Odd number. Q3. Write a C++ program that takes input week number (1-7) and print the corresponding day of week using C++, starting with Monday. Q4. Write a program which take a number from keyboard and checks the number whether that number is less than 100 or not if that number is less than 100 than check that is it less than 50 or not.int f(int &k){k++;return k * 2;}int main(){int i = 1, j = -1;int a, b, c;a = f(i) + i/2;b = j + f(j) + f(j);c = 2 * f(j);return 0;} What are the values of a, b and c id the operands in the expressions are evaluated from left to right and then what are the values when its evaluated right to left?(Pass or fail) Write a c++ program that prompts a student to enter a score.If the score is greater or equal to 60, display “you pass the exam”; otherwise, display “you don’t pass the exam”.Your program ends with input -1.Here is a sample run:Enter your score: 80You pass the exam.Enter your score: 59You don’t pass the exam.Enter your score: -1No numbers are entered except 0
- 2. a) Correct the code to print the following: 0 1 2 3 4 5 6 7 8 9 b) then rewrite the code with using the while loop. int[] numbers = new int[10]; for(int i=0; i < numbers.length; ++i) numbers[i] = i * 3; for(int i=0; i < numbers.length; ++i) System.out.print(numbers[i] / 2 + 1 + " "); System.out.println();3 - Write a program in C ++ to generate 35 random numbers between 1 and then print each 7 numbers on one line. (use srnad ())i). Write a C++ program to prompt the user to input her/his age and print it on the screen, asshown below.Your age is 20 years old. ii). Write a C++ program that asks the user for a number n and gives him the possibility to choosebetween computing the sum and computing the product of 1,...,n iii). Write a program that asks the user for a number n and gives him the possibility to choosebetween computing the sum and computing the product of 1,...,n. Expected output: 0,30,25,28