Subsequent statements set every element of matrix, Computer Engineering

Assignment Help:

Q. Subsequent statements set every element of matrix?

Let a= [2,4,6,8,10], b=[1,3,5,7,9], c=[0,0,0,0,0]

Consider the subsequent program section

FORALL (i = 2:4)

  a(i) = a(i-1)+a(i+1)

  c(i) = b(i) *a(i+1).

END FORALL

The calculations would be:

   a[2] =a[1]+a[3] =2+6=8

   a[3] =a[2]+a[4] =4+8=12

   a[4] =a[3]+a[5] = 6+10=16

   c[2] = b[2] *a[3] = 3*12=36

   c[3] = b[3] *a[4] = 5*16=80

   c[4] = b[4] *a[5] =7*10=70

So output is

a= [2,8,12,16,10], b=[1,3,5,7,9], c=[0,36,80,70,0]


Related Discussions:- Subsequent statements set every element of matrix

What are base tables of an aggregate object, What are base tables of an agg...

What are base tables of an aggregate object? The tables making up an aggregate object (primary and secondary) are known as aggregate object.

Software, its language base assignment

its language base assignment

What is difference between cobol and vs cobol ii, In using COBOL on PC we h...

In using COBOL on PC we have only flat files and the programs can access only limited storage, while in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on th

Program in c, addition c program for token separation

addition c program for token separation

Execution error and compilation error, Execution error and compilation erro...

Execution error and compilation error: Errors like as mismatch of data types or array out of bound error are called as execution errors or runtime errors. These errors are us

Types of structure charts, Types of Structure Charts Transaction struc...

Types of Structure Charts Transaction structure - control module calls subordinate modules, each of which handles a certain transaction More afferent processes Le

What is memory mapped i/o, What is memory mapped I/O? When the I/O devi...

What is memory mapped I/O? When the I/O devices share the similar address space, the arrangement is known as memory mapped I/O.

Differences between batch systems versus real-time systems, Question 1: ...

Question 1: a. Give NINE general properties of an MIS b. Name and explain the THREE main Problems and Issues of EIS Question 2: a. What are information systems for?

What types of calendars can you create with google calendar, What types of ...

What types of calendars can you create with Google Calendar? Personal calendars, like default calendar Public calendars, which others can access through the web

Features of read-only memory, Q. Features of read-only memory? ROMs are...

Q. Features of read-only memory? ROMs are memories on which it's not possible to write data when they are on-line to computer. They can only be read. This is reason why it is k

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd