1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GREYUIT [131]
3 years ago
12

Write a program that finds the largest in a series of numbers entered by the user.The program must prompt the user to enter numb

ers one by one.When the user enters 0 or a negative number, the program must display the largest nonnegative number entered:Enter a number:60Enter a number:38.3Enter a number:4.89Enter a number:100.62Enter a number:75.2295Enter a number: 0The largest number entered was 100.62.
Computers and Technology
1 answer:
Kobotan [32]3 years ago
4 0

Answer:

Here is c program:

#include<stdio.h>

#include<conio.h>

void main()

{

//Variable declaration

//array to hold 6 values you can change this as needed

float nums[6];

//integer i is for loop variable

int i;

//to hold maximum value

float max=0.0;

//clear screen

clrscr();

//iterate 6 times you can change as per your need

for(i=0;i<6;i++)

{

printf("Enter a number:");

scanf("%f",&nums[i]);

//check if entered value is greater than previous value

//if it is greater then assign it

if(nums[i]>max)

max = nums[i];

}

//print the value

printf("The largest number entered was %f",max);

getch();

}

Explanation:

You might be interested in
In what year did the manager and team depicted in the blockbuster film "Moneyball
mariarad [96]
2006 is the answer and the boston red sox were the first team to win 5 chamships 
3 0
3 years ago
Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This
Shtirlitz [24]

Answer:

def newton(n):

       #Define the variables.

       t = 0.000001

       esti = 1.0

       #Calculate the square root

       #using newton method.

       while True:

               esti = (esti + n / esti) / 2

               dif = abs(n - esti ** 2)

               if dif <= t:

                       break

   

       #Return the result.

       return esti

#Define the main function.

def main():

   

       #Continue until user press enters.

       while True:

               try:

         

                       #Prompt the user for input.

                       n = int(input("Enter a number (Press Enter to stop):"))

                       #display the results.

                       print("newton = %0.15f" % newton(n))

     

               except:

                       return

#Call the main function.

main()

7 0
3 years ago
What is the lower House​
statuscvo [17]
What lower house need context
6 0
3 years ago
Write a recursive, int-valued method named productOfOdds that accepts an integer array, and the number of elements in the array
lara [203]

Answer:

Program source code found in explaination

Explanation:

Recursive int function of the asked question.;

int productOfOdds(int array[],int length) {

int product=1;

if(length==0)

return -1;

else if(length==1) {

if(array[length-1]%2!=0)

return array[length-1];

else

return 1;

}

else {

product=productOfOdds(array,--length);

if(array[length]%2!=0) {

product=product*array[length];

}

}

return product;

}

4 0
3 years ago
A byte addressable direct-mapped cache has 1024 blocks/lines, with each block having eight 32-bit words. How many bits are requi
tino4ka555 [31]

Answer and Explanation:

"The inquiry as presented is not necessarily responsible. A word has been states as 32-bit. We need to ask if the frame is "byte-addressable" (From this we can access to get an 8-bit piece of information) or "text-addressable" (the smallest open lump is 32-bit) or maybe "half-word-addressable" (the tiny bundle of information it could reach to 16-bit).

To understand what the smallest request bit of a position is to let anyone know, you have to remember this.

You operate from base up at that stage. We will agree with the byte-addressable structure. Every reserved square at a certain point contains 8 words * (4 bytes/word) = 32 = 25 bytes, so the counterbalance seems to be 5 bits.

The history in a direct-mapped stored is the squares in reserves (12 bits for this position due to 212 = 4096). at a certain point, as you have seen, the tag is also one of the bits left behind.

As the reserve becomes increasingly cooperative. And a similar size remains. These are lesser bits on the list and more bits on the mark.'

8 0
3 years ago
Other questions:
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • To change a chart's data series, make the chart active, then in the data group on the chart tools design tab, click the _____ bu
    9·1 answer
  • Linux would be a good example of?
    6·1 answer
  • 2.1 Changes in which factors could cause aggregate demand to shift from AD to AD1? What could happen to the unemployment rate? W
    8·1 answer
  • Is it safe to take apart a computer monitor?
    13·1 answer
  • What does the binary odometer show about representing large numbers?
    8·1 answer
  • Give an example of a situation in which a compromise of Confidentiality leads to compromise in Integrity.Situation where confide
    8·1 answer
  • ____________________ is the primary code humans use to communicate. (Points : 1
    9·1 answer
  • Help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!​
    9·1 answer
  • What is incorrect about the following code? Suggest a possible revision of the code to correct the error.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!