WEEK: 7 PROGRAM 1 AND PROGRAM 2 NPTEL Problem Solving through Programming in C (Jan 27) 2020 solutions


PROBLEM SOLVING THROUGH PROGRAMMING IN C.

By Prof. ANUPAM BASU


WEEK 7:PROGRAM 1:

Write a C Program to Count Number of Uppercase and Lowercase Letters in a given string. The string may be a word or a sentence. 


 for(int i =0; ch[i]!= '\0'; i++)
   {
      
      if(ch[i] >= 'A' && ch[i] <= 'Z')
      { upper++; }

      else if(ch[i] >= 'a' && ch[i] <= 'z')
      { lower++; }
     
    }

WEEK 7:PROGRAM 2:

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

 int sum=0; 
for(i=0;i< r;i++) //Accepts the matrix elements from the test case data
    {

        for(j=0;j< c;j++)
        {
            sum=sum+matrix[i][j];
        }
  printf("%d\n",sum);
  sum=0;
    }
return 0;
}



Week-7 :Program-03 Answers And Program-04
CLICK ON BELOW LINK.
<<CLICK HERE FOR  WEEK 7 :PROGRAM -03>>

<<CLICK HERE FOR  WEEK 7 :PROGRAM-04>> FOLLOW OUR WEBSITE FROM THE BUTTON PROVIDED TO THE BOTTOM OF PAGE TO GET SOON ANSWERS OF PROGRAMS.
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100%  correct solutions.

No comments:

Post a Comment

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages