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
N76 [4]
3 years ago
10

Write a program in C which asks the user for 10 integers and prints out the biggest one.

Computers and Technology
1 answer:
Anni [7]3 years ago
5 0

Answer:

Following are the program in c language

#include<stdio.h> // header file

int main() // main function

{

   int ar[10],k,biggest; // variable declaration

   printf("Enter the ten values:\n");

   for (k = 0;k < 10; k++)  

   {

      scanf("%d", &ar[k]); // user input of 10 number

   }

   biggest = ar[0]; // store the array index of 0 into biggest variable

   for (k = 0; k< 10; k++) // finding the biggest number  

   {

    if (ar[k] >biggest)  

    {

    biggest = ar[k];

   }

   }

printf(" biggest num is %d", biggest); // display the biggest number

return 0;

}

Output:

Enter the ten values:

12

2

4

5

123

45

67

453

89

789

biggest num is 789

Explanation:

Here we declared an array ar[10] of type int which store the 10 integer values.

Taking 10 integer input from the user in array ar .After that iterating the loop and finding the biggest number by using if statement  and store the biggest number in biggest variable .

Finally display biggest number.

You might be interested in
The following code is intended to test whether the int variable num is less than 10, and if so print a warning and set it to 10.
hoa [83]

The only correction I see is you need to add curly braces to enclose the second and third lines.

6 0
3 years ago
Why would you use a billeted list in a slide presentation?
Damm [24]

Answer:

You would use a Bullet Point on a slide presentation because its concise and to the point.

Explanation:

The correct way to use a Bullet point is to keep it simple. Its not made to be a full sentence. You need to create a bullet point you can expand upon. when you keep it plain and simple you can get more info on your points.

7 0
3 years ago
Python code 100 Random Numbers (twice)
Leona [35]

import random

i = 1

while i <= 100:

   print("#"+str(i)+": "+str(random.randint(1,100)), end=", ")

   i+=1

print()

i = 1

while i <= 100:

   print("#"+str(i)+": "+str(random.uniform(1,100)), end=", ")

   i += 1

I hope this helps!

8 0
3 years ago
3. The following code will not display the results expected by the programmer. Can
Elena L [17]

Answer:

ion k

Explanation:

7 0
3 years ago
Which line in the following program will cause a compiler error? #include using namespace std; int main() { int number =5; if (n
DanielleElmas [232]

Answer:

  1. #include  <iostream>
  2. using namespace std;
  3. int main() {
  4. int number =5;
  5. if (number>=0&& number <=100){
  6.    cout<<"passed.\n";
  7. }
  8. else{
  9.    cout<<"failed.\n";
  10. }
  11. return 0;
  12. }

Explanation:

There where multiple errors in the code given in the questions

Line 1: Missing <iostream>

Line 5: The comparison operator was wrong correction is highlighted

Line 12 Missing closing brace for the main function

All the errors have been fixed and the code above compiles

4 0
3 years ago
Other questions:
  • What microsoft operating systems started the process of authenticating using password and username
    14·1 answer
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • what type of machine is a ramp for wheelchairs? compound machine, mechanical, machine complex machine, simple machine
    15·2 answers
  • How do the companies gather data to determine common passwords?
    13·1 answer
  • When using file explorer, the right-hand pane that shows the files and folders of the selected area is called the pane?
    7·1 answer
  • How are special characters added to a Word document? Check all that apply.
    6·2 answers
  • Which of the following translates packets so that the node can understand them once they enter through a port?
    5·2 answers
  • Provide an example where a company has demonetized a market or industry.
    8·1 answer
  • Typically, a DVD has how many times more capacity than a CD?
    12·1 answer
  • What facilitates the automation and management of business processes and controls the movement of work through the business proc
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!