NPTEL Problem Solving Trough Programming In C | NPTEL Week 7 Programming Assignment | NPTEL Assignment Solutions

NPTEL Problem Solving Trough Programming In C Week 7 Programming Assignment | NPTEL Swayam Assignment Answers  


problem solving through programming in C nptel



Nptel Week 7 Programming Assignment Answers:


Q.1: Write a C program to find the sum of all elements of each row of a matrix.
 Example:
For a matrix
 4 5 6
 6 7 3
 1 2 3

 The output will be
 15
 16
 6


write a C program to find the sum of all elements of each row of a matrix


Code:





Q.2: Write a C program to find subtraction of two matrices i.e. matrix_A - matrix_B=matrix_C.
If the given martix are
 2 3 5 and 1 5 2 Then the output will be 1 -2 3
 4 5 6        2 3 4                                       2 2 2
 6 5 7        3 3 4                                       3 2 3
 The elements of the output matrix are separated by one blank space.


write a C program to find subtraction of two matrices


Code:





Q.3: Write a C program to print lower triangle of a square matrix.
For example the output of a given matrix
 2 3 4 will be 2 0 0
5 6 7      5 6 0
4 5 6      4 5 6


write a C program to print lower triangle of a square matrix


Code:





Q.4: Write a C program to print Largest and Smallest Word from a given sentence. If there are two or more words of same length, then the first one is considered. A single letter in the sentence is also consider as a word.


write a C program to print largest and smallest word from a given sentence


Code:




If you are facing any queries regarding this assignment solutions, then please drop comment in comment section.

Post a Comment

0 Comments