Posted by: alpha September 29, 2009
C-program experts! PLZ help
Login in to Rate this Post:     0       ?        
Hey guys I need to have the solutions of some questions related to C-Program.
I would be very very grateful to you guys, if you could kindly post the solutions for those questions. Thanks in advance!



Q.1 Write
a program to read in an NxN matrix and square it according the formula

       Sij = Σ(k=1 to N) Aik Akj.
Where A is the original matrix



 



Q.2  Write a program to read in starting values A,
X1, Y1 and perform the following     iteration:



 
      X i+1
= Y i 2 - X i



 
      Y i+1
= X i  -A
                 N times (N read in)



       Then output the
answer X N+1 ,Y N+1 . Don’t use Dimensioned variables.



 



Q.3  Write a program to input two vectors of
arbitrary length N ( the same for both     vectors),

      ai and bi and calculate the dot product
defined as  Σ(i=1
to N)
ai bi  and output
the result.



 



Q.4 Write a
program to perform;  Integration( 0 to 1) e-x^2 dx  using rectangles, i.e. break  up the  region into N+1 intervals, each of
width 1/N, and multiply the width by the values of e-x^2  at the start and end of the interval and
divide by 2 ; Then sum this over all intervals. Leave N variable.



 




Read Full Discussion Thread for this article