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
arlik [135]
4 years ago
9

How do I write a program in Pascal that finds the index of the minimum number of an array(using Function) and replaces it to a n

umber inputted from the keyboard ?(Input and output of the array is a Procedure).
Computers and Technology
1 answer:
nordsb [41]4 years ago
5 0

Answer:

program arraysminfinder;

procedure minreplace();

var

no: array [1..10] of integer;  (*no is an array of integers, 10 in all *)

a: integer= 0;

i: integer= 0;

c: integer= 0;

k: integer=0;

N: integer=0;

begin

(* We need to first initialize the array no with 0 values *)

for a := 1 to 10 do

no[a]:=0;

c:=no[1];

for a := 1 to 10 do

begin

  if (no[i]<c) then

  begin

   c:=no[i];

   k:=i;

  end

  else

  begin

      i:=i+1;

  end

 end;

  writeln('Enter the new number:');

  read(N);

  no[k]:=N;

  for a := 1 to 10 do

  begin

     writeln('The array elements are:',no[a]);

   end;

end;

begin

end.

Explanation:

The program is as above.  I have used a function, a for loop, an array of integers, and the if then else ladder for getting the desired output as mentioned in the program. If in case you want procedure for input and output, create a procedure like:

procedure replacenum():integer;

Begin

 writeln("Enter the new number:" N);

    no[k]:=N;

   for a := 1 to 10 do

         writeln("The array elements are:"no[a]);

 end.

Similarly you can make a procedure for input.

You might be interested in
Hello can you please help with this if you want to thank you!
nikklg [1K]

Answer:

hardware and software is the answer

8 0
3 years ago
Read 2 more answers
Why are the relational operators called relational?
Pie
If you think about it, all "relational operators" are used to test some kind of relationship between two objects or entities. :)
3 0
4 years ago
Read 2 more answers
What are the importance of computer in today's generation​
MariettaO [177]

Answer:

We use it everyday for all sorts of stuff

Explanation:

8 0
3 years ago
Which loan type requires you to make loan payments while you’re attending school?
mixer [17]
Direct Subsidized Loans<span> are available only to undergraduate students who have financial need. Direct Unsubsidized </span>Loans<span> are available to both undergraduates and graduate or professional degree students. </span>You<span> are not </span>required<span> to show financial need to receive a Direct Unsubsidized </span>Loan<span>.

Hope this answer helps! feel free to ask any additional questions :)</span>
4 0
3 years ago
Should i turn off my computer when a program becomes unresponsive?
DaniilM [7]
I'm not sure why you would need to. An unresponsive program should not effect the integrity of the system to require a reboot.

If an unresponsive program is being particular persistent and won't exit, CTRL + ALT + DEL then Task Manager, and clicking on the program in the "Processes" tab and clicking "End Task" is a reliable way to get rid of it.
4 0
3 years ago
Other questions:
  • Which of the following makes videos appear smoother and more fluid?
    9·2 answers
  • Which of the following locations would most likely have the most fertile soil?
    8·1 answer
  • What is the most happy job work? that can earn $1000 per day at homes? show company website links
    5·1 answer
  • write the structure of an email message ques.2 what do you mean by search engine? write its component .ques. 3 what are the adva
    9·1 answer
  • What is a Joint Staff approved, standardized communications link that is suitable for the transmission of digital information an
    5·1 answer
  • Jose has 3/5 kilogram of peppermints and 2/3 kilogram of candy canes. How many kilograms of candy does he have?
    10·1 answer
  • Order the steps for changing the settings of an outlook data file
    10·1 answer
  • To defeat SQL injection attacks, a web application has implemented a filtering scheme at the client side: basically, on the page
    15·1 answer
  • Instruction: weird I know (~ ̄³ ̄)~
    5·1 answer
  • What report provides data on how specific sections of a website performed?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!