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
Do you think people are willing to buy these products? Why?
SSSSS [86.1K]
What products ma’am/sir
3 0
3 years ago
Read 2 more answers
You should adopt naming standards that do not convey information to potential system attackers.
Nonamiya [84]
True








------------------------------
5 0
3 years ago
Ally typed a business letter. She used a _____.
Jet001 [13]
Ally typed a business letter. She used a word processor.
5 0
4 years ago
What is the output of the following code? public class Test { public static void main(String[] args) { new Person().printPerson(
fredd [130]

Answer:

The output of the given question is :

Person

Person

Explanation:

Following are the description of Statements

  • The new Person().printPerson(); calling the function of printPerson() of the class Person so it returns the Person in the console window.
  • The new Student().printPerson(); calling the function of printPerson() of the class student .The student inherits the class Person So control will moves to the class it executed the statement inside the Person class So it executed the function public void printPerson() of the Person class so it also returns the Person String and execution of program become stops
3 0
3 years ago
Studying MyMagic+ helps one understand the costs associated with information systems deployment at scale. According to your read
vlabodo [156]

Answer:

The answer is "Training".

Explanation:

It is a technology programming that relates to tools, organizations, and services. It focused on helping consumers learn about technology-related topics. It is also known as the registered technology training services, that educate and assist customers in different fields, and incorrect option can be defined as follows:

  • bands readers, It refers to book, which is used in reading.
  • iPod Touch, It is a hardware device.
  • PDAs refer to a hardware device like a palmtop.
8 0
4 years ago
Other questions:
  • What is print media?
    14·1 answer
  • Find functions f1 and f2 such that both f1 and f2 are O(g(n)), but f1(n) is not O(f2)
    6·1 answer
  • The picture that graphically represents the items you use in windows is called a/an
    15·2 answers
  • Sensitive security information can be shared with whom
    13·2 answers
  • Which of the following is not a responsibility of a member of society?
    14·1 answer
  • Anyone Free to Talk??????? I'm Bored :(
    6·2 answers
  • A tool in Word that creates multiple copies of the same letter, envelope, or label and inserts personalized data is a(n) _____.
    12·1 answer
  • ________ did you sell your computer to?​
    9·1 answer
  • Haya would like to complemely delete Slide 11 from her presentation so that slides 12–16 become slides 11-15. What is
    9·1 answer
  • Declare a struct of your choice (Employee, Student etc). Delcare a node for singly link list. Declare an ADT of this linklist. T
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!