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
ASHA 777 [7]
4 years ago
11

Write a function which will ask users to enter numbers and return the largest number.

Computers and Technology
1 answer:
kherson [118]4 years ago
8 0

Answer:

#include<stdio.h>

int GetLargest()

{

int a[100],n,largest;

printf("Enter number of elements\n");

scanf("%d",&n);

printf("Enter elements\n");

for(int i=0;i<n;i++)

scanf("%d",&a[i]);

i=0;

largest=a[i];

while(i<n)

{

i++

if(a[i]>largest)

largets=a[i];

}

return largest;

}

void main(){

int largest;

largest=GetLargest();

printf("Largest Number is %d",largest);

}

Explanation:

Here we define one function "GetLargest". This function reads n number of elements and finds the largest number among the n elements. Here we took one array and assumed first element is the largest element. if any element of the array is greater that that element we make that as larger and continues.at the end we are getting largest element in the n numbers and returning that to the main.

You might be interested in
Choose all items that represent characteristics of an HTML element. used to include additional information in an attribute consi
Sphinxa [80]

Answer:

Explanation:

We could find different kind of tags in HTML, in this case, we can choose the tag <p> we're going to see all the items about this tag.

We can close the tag with the symbol /

<p> example </p>

We can add id or class in this tag

<p id="example"> example </p>

<p class="example"> example </p>

this help up to add CSS code, but we can add style direct in the HTML code:

<p style="color: red;"> example </p>

In this example the text going to be color red

8 0
4 years ago
How can simulations be used in education?
vesna_86 [32]
Simulation has a lot to do with computer coding, computer games, etc. Due to the use of how much computers are used in this day and age, simulations can be used even for homeschoolers in whom do school online. 
5 0
4 years ago
Read 2 more answers
Which line of code could be used for a constructor?
uysha [10]

Explanation:

I think (first name last name id Num)

4 0
3 years ago
What statement best decribes the relashionship bewteen science and technoligy?
butalik [34]
The correct answer would be A.
7 0
4 years ago
Read 2 more answers
Menus are attached to windows by calling the _____ method.
Talja [164]

Answer: Set J Menu bar

Explanation:

J Menu bar class are used to display the menu bar in the window and frame. it basically inherited from the j menu class and it has various menus.

By using the J menu bar we can create the menu in java. The J menu class object is an element of pull down menu and it is used to display in he menu bar.  

And the menu are attached with the frame by using J frame.setJMenu Bar.  

5 0
3 years ago
Other questions:
  • Your mission is to read this uber-classified memo from the Grand Poobah of annan. Of course, it's in code, so you'll need to wri
    15·1 answer
  • Question # 6
    13·1 answer
  • A software company is weighing whether to release a new version of its software as scheduled. The company can go ahead and relea
    5·1 answer
  • Description A data retrieval tool that finds specified data within a database A collection of records All of the fields for a si
    7·1 answer
  • Can you see it now ivy97? I've posted it again.
    8·1 answer
  • You can include up to _____ logical conditions in the and function. (487181)
    12·1 answer
  • Which position is expected to be at the center of the action providing complete technology solutions for a business?
    12·1 answer
  • With what software tool can you see the applications that are currently runni
    13·1 answer
  • What are the three primary components of an inbox?
    11·1 answer
  • Write a program that will input two numbers and print the larger number on the screen.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!