ABOUT THE COURSE :

Problem Solving Through Programming In C Week 12 Solutions

Disclaimer: The answers to these questions are provided for educational and informational purposes only. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself.

This course is aimed at enabling the students to
    1. Formulate simple algorithms for arithmetic and logical problems 
    2. Translate the algorithms to programs (in C language) 
    3. Test and execute the programs and correct syntax and logical errors
    4. Implement conditional branching, iteration and recursion
    5. Decompose a problem into functions and synthesize a complete program using divide and conquer approach
    6. Use arrays, pointers and structures to formulate algorithms and programs
    7. Apply programming to solve matrix addition and multiplication problems and searching and sorting problems
    8. Apply programming to solve simple numerical method problems, namely rot finding of function, differentiation of function and simple integration

Summary
Course Type Elective
Duration 12 weeks
Category Computer Science and Engineering
Start Date 22 Jan 2024
End Date 12 Apr 2024
Exam Registration Ends 16 Feb 2024
Exam Date 21 Apr 2024 IST

Assignment Solutions :

Programming Assignment :

Week-10: Program-01 :
for (c = 0; c < n; c++)
    {
      if (array[c] == search)
      {
         printf("%d is present at location %d.\n", search, c+1);
         count++;
      }
    }
   if (count == 0)
      printf("%d is not present in the array.", search);
   else
    

Week-10: Program-02 :
float h;
    for (itr=1; itr<=maxmitr; itr++)
    {
        h=f(x0)/df(x0);
        x1=x0-h;
        x0=x1;
    }
    printf("Root = %8.6f", x1);
    return 0;
}
float f(float x)
{
    return x*x*x - 2*x  - 3;
}
float df (float x)
{
    return 3*x*x-2;
}

Week-10: Program-03 :
Write a C program to sort a given 1D array using pointer in ascending order.
int j,t;
for (i=0; i<(n-1); i++) 
    {
        for (j=i+1; j<n; j++)
        {
            if (*(a+i)>*(a+j))
            {
                t=*(a+i);
                *(a+i)=*(a+j);
                *(a+j)=t;
            }
        }
    }

Week-10: Program-04 :
Write a C program to sort a 1D array using pointer by applying Bubble sort technique.
void sort(int *a, int n)
{
    int i,temp,j;
    for(i=1;i<n;i++)
    {
        for(j=0;j<n-i;j++)
        {
           if(*(a+j)>=*(a+j+1))
        {
            temp = *(a+j);
            *(a+j)= *(a+j+1);
            *(a+j+1)= temp;
        }
        }
    }
}

CRITERIA TO GET A CERTIFICATE :
  1. Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
  2. Exam score = 75% of the proctored certification exam score out of 100
  3. Final score = Average assignment score + Exam score
YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met,you will not get the certificate even if the Final score >= 40/100.

Join With Us On :