swayam-logo

Problem Solving Through Programming In C

  • Formulate simple algorithms for arithmetic and logical problems
  • Translate the algorithms to programs (in C language)
  • Test and execute the programs and  correct syntax and logical errors
  • Implement conditional branching, iteration and recursion
  • Decompose a problem into functions and synthesize a complete program using divide and conquer approach
  • Use arrays, pointers and structures to formulate algorithms and programs
  • Apply programming to solve matrix addition and multiplication problems and searching and sorting problems 
  • Apply programming to solve simple numerical method problems, namely rot finding of function, differentiation of function and simple integration
--> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> -->

Note: This exam date is subject to change based on seat availability. You can check final exam date on your hall ticket.

Page Visits

Course layout, books and references, instructor bio.

problem solving through programming in c week 6

Prof. Anupam Basu

Course certificate.

  • Assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course. 
  • ( All assignments in a particular week will be counted towards final scoring - quizzes and programming assignments). 
  • Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam - out of 100
  • Proctored Exam score =50% of the proctored certification exam score out of 100

problem solving through programming in c week 6

DOWNLOAD APP

problem solving through programming in c week 6

SWAYAM SUPPORT

Please choose the SWAYAM National Coordinator for support. * :

NPTEL

  • Announcements
  • Explore Courses

Problem solving through Programming In C

  • BE/BTech  in all disciplines
  • BCA/MCA/M. Sc
  • All IT Industries

65741 students have enrolled already!!

problem solving through programming in c week 6

In association with

problem solving through programming in c week 6

Problem Solving Through Programming In C Nptel Week 6 Assignment Answers

Are you looking for the Problem Solving Through Programming In C Week 6 Answers 2024 ? You’ve come to the right place! This resource offers comprehensive solutions to the Week 6 assignment questions, focusing on fundamental concepts in C programming.

Course Link: Click Here

Table of Contents

Problem Solving Through Programming In C Nptel Week 6 Assignment Answers

Problem Solving Through Programming In C Week 6 Answers (July-Dec 2024)

Q1. What is the right way to initialise an array in C? a) int arr{}={1,2,5,6,9} b) int arr[5]={1,2,5,6,9} c) int arr{5}={1,2,5,6,9} d) int arr()={1,2,5,6,9}

Answer: b) int arr[5]={1,2,5,6,9}

Q2An integer array of dimension 10 is declared in a C program. The memory location of the first byte of the array is 1000. What will be the location of the 8th element of the array? (Assume integer takes 4 bytes of memory and the element stored at 1000 is identified as 1st element) a) 1028 b) 1032 c) 1024 d) 1036

Answer: a) 1028

For answers or latest updates join our telegram channel: Click here to join

Q3. ‘What will be the output after execution of the program?

a) 1 b) 2 c) 3 d) 4

Answer: a) 1

Q4 .Which of the statements is correct? a) An array contains more than one element b) All elements of array have to be of same data type c) The size of array has to be declared upfront d) All of the above

Answer : d) All of the above

Q5. To compare two arrays, we can use a) Comparison operator ‘==’ directly on arrays b) Use ‘switch case’ c) Using ‘for’ loop d) Using ternary operator on arrays

Answer: c) Using ‘for’ loop

Q6. Find the output of the following C program

a) 5,4 b) 5,5 c) 4,4 d) 3,4

Answer : c) 4,4

These are Problem Solving Through Programming In C Week 6 Answers

Q7. ‘What will be the output?

a) i=5, j=5, k=2 b) i=6, j=5, k=3 c) i=6, j=4, k=2 d) i=5, j=4, k=2

Answer: a) i=5, j=5, k=2

Q8. Array elements are stored in memory in the following order a) Contiguous b) Random c) Both contagious and random d) None

Answer: a) Contiguous

Q9. ‘What is the output of the below C program?

Q10 .How many ‘a’ will be printed when the following code is executed?

Answer: b) 6

All weeks of Problem Solving Through Programming in C : Click Here

More Nptel Courses:  https://progiez.com/nptel-assignment-answers

Problem Solving Through Programming In C Week 6 Answers (JULY-DEC 2023 )

Course Name: Problem Solving Through Programming In C

Course Link:  Click Here

These are Problem Solving Through Programming In C Assignment 6 Answers

Q1. What is an array in C? a) A collection of similar data elements with the same data type. b) A built-in function that performs mathematical calculations. c) A keyword used for declaring variables. d) A data type used to store characters only.

Answer: a) A collection of similar data elements with the same data type.

Q2. What is the index of the first element in an array? a) 0 b) 1 c) -1 d) The index can vary depending on the array size.

Answer: a) 0

Q3. Which loop is commonly used to iterate through all elements of an array in C? a) for loop b) while loop c) do-while loop d) switch loop

Answer: a) for loop

Q4. An integer array of 15 elements is declared in a C program. The memory location of the first byte of the array is 2000. What will be the location of the 13th element of the array? Assume int takes 2 bytes of memory. a) 2013 b) 2024 c) 2026 d) 2030

Answer: b) 2024

Q5. How can you find the sum of all elements in a 1D array “arr” with 5 elements using loop in C? a) sum= arr[0] + arr[1] + arr[2] + arr[3] + arr[4]; b) sum = arr[5]; c) for (int i = 0; i <= 5; i++) { sum += arr[i]; } d) for (int i = 0; i < 5; i++) { sum += arr[i]; }

Answer: d) for (int i = 0; i < 5; i++) { sum += arr[i]; }

Q6. What is the output of the following code? a) 1 3 5 b) 1 2 3 4 5 c) 1 2 3 d) 1 4

Answer: a) 1 3 5

Q7. What will be the output? a) i=5, j=5, k=2 b) i=6, j=5, k=3 c) i=6, j=4, k=2 d) i=5, j=4, k=2

Q8. What will be the output after execution of the program? a) 1 b) 2 c) 3 d) 4

Answer: d) 4

Q9. What will be the output?

Q10. Find the output of the following C program a) 5, 4 b) 5, 5 c) 4, 4 d) 3, 4

Answer: c) 4, 4

Question 1 Write a C Program to find Largest Element of an Integer Array. Here the number of elements in the array ‘n’ and the elements of the array is read from the test data. Use the printf statement given below to print the largest element. printf(“Largest element = %d”, largest);

Question 2 Write a C Program to print the array elements in reverse order (Not reverse sorted order. Just the last element will become first element, second last element will become second element and so on) Here the size of the array, ‘n’ and the array elements is accepted from the test case data. The last part i.e. printing the array is also written. You have to complete the program so that it prints in the reverse order.

Question 3 Write a C program to read Two One Dimensional Arrays of same data type (integer type) and merge them into another One Dimensional Array of same type.

Question 4 Write a C Program to delete duplicate elements from an array of integers.

More Weeks of Problem Solving Through Programming In C:  Click here

More Nptel Courses:  Click here

Problem Solving Through Programming In C Week 6 Answers (JAN-APR 2023 )

Q1. Which statement is correct? a) An index or subscript in array is a positive integer b) An index or subscript in array is a positive or negative integer c) An index or subscript in array is a real number d) None of the above

Answer: a) An index or subscript in array is a positive integer

Q2. Which of the following is the correct way to declare a one-dimensional integer array named “myArray” with 5 elements in C? a) int myArray(5); b) int myArray[5]; c) int myArray = [5]; d) int myArray = {5};

Answer: b) int myArray[5];

Q3. The elements of array are stored in contiguous memory due to a) This way computers can keep track of only the address of the first element and the addresses of other elements can be calculated. b) The architecture of computer does not allow arrays to store other than serially c) Both (a) and (b) are true d) None of these are true

Answer: a) This way computers can keep track of only the address of the first element and the addresses of other elements can be calculated.

image 82

a) 0 b) 1 c) 5 d) The code will result in a runtime error.

Answer: d) The code will result in a runtime error.

Problem Solving Through Programming In C Nptel Week 3 Assignment Answers

100 Most Popular Courses For September

problem solving through programming in c week 6

Harvard and MIT’s $800 Million Mistake: The Triple Failure of 2U, edX, and Axim Collaborative

The future of Coursera’s only credible alternative for universities rests in the hands of 2U’s creditors.

  • 7 Best Autodesk Maya Courses for 2024: Exploring 3D Animation
  • [2024] The 100 Top FREE EdX Courses of All Time
  • 15 Best Lisp Courses for 2024
  • 8 Best Adobe XD Courses for 2024
  • [2024] 250 Top FREE Coursera Courses of All Time

600 Free Google Certifications

Most common

  • data science

Popular subjects

Web Development

Communication Skills

Digital Marketing

Popular courses

Matrix Algebra for Engineers

Competencias para buscar, mantener y promocionar en un empleo

Fundamentals of Neuroscience, Part 1: The Electrical Properties of the Neuron

Organize and share your learning with Class Central Lists.

View our Lists Showcase

Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Problem Solving Through Programming in C

Indian Institute of Technology, Kharagpur and NPTEL via Swayam Help

Anupam Basu

Related Courses

Programming & data structures, data structures & algorithms using c++, introduction to programming, programming, data structures and algorithms using python, problem solving, python programming, and video games, related articles, 500+ ugc-approved online degrees from india’s top universities, swayam + nptel courses full list, 900 free computer science courses from world’s top 50 universities, 150+ stanford on-campus computer science courses available online, 10 best c courses for 2024: code at the core.

3.0 rating, based on 1 Class Central review

Select rating

Start your review of Problem Solving Through Programming in C

  • AYUSH JAISWAL 3 years ago Can be explained in a better way and slides could have been provided as study materials. Better to add some more examples for students to understand. Helpful

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

  • C Data Types
  • C Operators
  • C Input and Output
  • C Control Flow
  • C Functions
  • C Preprocessors
  • C File Handling
  • C Cheatsheet
  • C Interview Questions

C Exercises – Practice Questions with Solutions for C Programming

The best way to learn C programming language is by hands-on practice. This C Exercise page contains the top 30 C exercise questions with solutions that are designed for both beginners and advanced programmers. It covers all major concepts like arrays, pointers, for-loop, and many more.

C-Exercises

So, Keep it Up! Solve topic-wise C exercise questions to strengthen your weak topics.

C Programming Exercises

The following are the top 30 programming exercises with solutions to help you practice online and improve your coding efficiency in the C language. You can solve these questions online in GeeksforGeeks IDE.

Q1: Write a Program to Print “Hello World!” on the Console.

In this problem, you have to write a simple program that prints “Hello World!” on the console screen.

For Example,

Click here to view the solution.

Q2: write a program to find the sum of two numbers entered by the user..

In this problem, you have to write a program that adds two numbers and prints their sum on the console screen.

Q3: Write a Program to find the size of int, float, double, and char.

In this problem, you have to write a program to print the size of the variable.

Q4: Write a Program to Swap the values of two variables.

In this problem, you have to write a program that swaps the values of two variables that are entered by the user.

Swap-two-Numbers

Swap two numbers

Q5: Write a Program to calculate Compound Interest.

In this problem, you have to write a program that takes principal, time, and rate as user input and calculates the compound interest.

Q6: Write a Program to check if the given number is Even or Odd.

In this problem, you have to write a program to check whether the given number is even or odd.

Q7: Write a Program to find the largest number among three numbers.

In this problem, you have to write a program to take three numbers from the user as input and print the largest number among them.

Q8: Write a Program to make a simple calculator.

In this problem, you have to write a program to make a simple calculator that accepts two operands and an operator to perform the calculation and prints the result.

Q9: Write a Program to find the factorial of a given number.

In this problem, you have to write a program to calculate the factorial (product of all the natural numbers less than or equal to the given number n) of a number entered by the user.

Q10: Write a Program to Convert Binary to Decimal.

In this problem, you have to write a program to convert the given binary number entered by the user into an equivalent decimal number.

Q11: Write a Program to print the Fibonacci series using recursion.

In this problem, you have to write a program to print the Fibonacci series(the sequence where each number is the sum of the previous two numbers of the sequence) till the number entered by the user using recursion.

FIBONACCI-SERIES

Fibonacci Series

Q12: Write a Program to Calculate the Sum of Natural Numbers using recursion.

In this problem, you have to write a program to calculate the sum of natural numbers up to a given number n.

Q13: Write a Program to find the maximum and minimum of an Array.

In this problem, you have to write a program to find the maximum and the minimum element of the array of size N given by the user.

Q14: Write a Program to Reverse an Array.

In this problem, you have to write a program to reverse an array of size n entered by the user. Reversing an array means changing the order of elements so that the first element becomes the last element and the second element becomes the second last element and so on.

reverseArray

Reverse an array

Q15: Write a Program to rotate the array to the left.

In this problem, you have to write a program that takes an array arr[] of size N from the user and rotates the array to the left (counter-clockwise direction) by D steps, where D is a positive integer. 

Q16: Write a Program to remove duplicates from the Sorted array.

In this problem, you have to write a program that takes a sorted array arr[] of size N from the user and removes the duplicate elements from the array.

Q17: Write a Program to search elements in an array (using Binary Search).

In this problem, you have to write a program that takes an array arr[] of size N and a target value to be searched by the user. Search the target value using binary search if the target value is found print its index else print ‘element is not present in array ‘.

Q18: Write a Program to reverse a linked list.

In this problem, you have to write a program that takes a pointer to the head node of a linked list, you have to reverse the linked list and print the reversed linked list.

Q18: Write a Program to create a dynamic array in C.

In this problem, you have to write a program to create an array of size n dynamically then take n elements of an array one by one by the user. Print the array elements.

Q19: Write a Program to find the Transpose of a Matrix.

In this problem, you have to write a program to find the transpose of a matrix for a given matrix A with dimensions m x n and print the transposed matrix. The transpose of a matrix is formed by interchanging its rows with columns.

Q20: Write a Program to concatenate two strings.

In this problem, you have to write a program to read two strings str1 and str2 entered by the user and concatenate these two strings. Print the concatenated string.

Q21: Write a Program to check if the given string is a palindrome string or not.

In this problem, you have to write a program to read a string str entered by the user and check whether the string is palindrome or not. If the str is palindrome print ‘str is a palindrome’ else print ‘str is not a palindrome’. A string is said to be palindrome if the reverse of the string is the same as the string.

Q22: Write a program to print the first letter of each word.

In this problem, you have to write a simple program to read a string str entered by the user and print the first letter of each word in a string.

Q23: Write a program to reverse a string using recursion

In this problem, you have to write a program to read a string str entered by the user, and reverse that string means changing the order of characters in the string so that the last character becomes the first character of the string using recursion. 

Reverse-a-String

reverse a string

Q24: Write a program to Print Half half-pyramid pattern.

In this problem, you have to write a simple program to read the number of rows (n) entered by the user and print the half-pyramid pattern of numbers. Half pyramid pattern looks like a right-angle triangle of numbers having a hypotenuse on the right side.

Q25: Write a program to print Pascal’s triangle pattern.

In this problem, you have to write a simple program to read the number of rows (n) entered by the user and print Pascal’s triangle pattern. Pascal’s Triangle is a pattern in which the first row has a single number 1 all rows begin and end with the number 1. The numbers in between are obtained by adding the two numbers directly above them in the previous row.

pascal-triangle

Pascal’s Triangle

Q26: Write a program to sort an array using Insertion Sort.

In this problem, you have to write a program that takes an array arr[] of size N from the user and sorts the array elements in ascending or descending order using insertion sort.

Q27: Write a program to sort an array using Quick Sort.

In this problem, you have to write a program that takes an array arr[] of size N from the user and sorts the array elements in ascending order using quick sort.

Q28: Write a program to sort an array of strings.

In this problem, you have to write a program that reads an array of strings in which all characters are of the same case entered by the user and sort them alphabetically. 

Q29: Write a program to copy the contents of one file to another file.

In this problem, you have to write a program that takes user input to enter the filenames for reading and writing. Read the contents of one file and copy the content to another file. If the file specified for reading does not exist or cannot be opened, display an error message “Cannot open file: file_name” and terminate the program else print “Content copied to file_name”

Q30: Write a program to store information on students using structure.

In this problem, you have to write a program that stores information about students using structure. The program should create various structures, each representing a student’s record. Initialize the records with sample data having data members’ Names, Roll Numbers, Ages, and Total Marks. Print the information for each student.

We hope after completing these C exercises you have gained a better understanding of C concepts. Learning C language is made easier with this exercise sheet as it helps you practice all major C concepts. Solving these C exercise questions will take you a step closer to becoming a C programmer.

Frequently Asked Questions (FAQs)

Q1. what are some common mistakes to avoid while doing c programming exercises.

Some of the most common mistakes made by beginners doing C programming exercises can include missing semicolons, bad logic loops, uninitialized pointers, and forgotten memory frees etc.

Q2. What are the best practices for beginners starting with C programming exercises?

Best practices for beginners starting with C programming exercises: Start with easy codes Practice consistently Be creative Think before you code Learn from mistakes Repeat!

Q3. How do I debug common errors in C programming exercises?

You can use the following methods to debug a code in C programming exercises Read the error message carefully Read code line by line Try isolating the error code Look for Missing elements, loops, pointers, etc Check error online

Please Login to comment...

Similar reads.

  • Discord Emojis List 2024: Copy and Paste
  • Best Adblockers for Twitch TV: Enjoy Ad-Free Streaming in 2024
  • PS4 vs. PS5: Which PlayStation Should You Buy in 2024?
  • Best Mobile Game Controllers in 2024: Top Picks for iPhone and Android
  • System Design Netflix | A Complete Architecture

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Quizermania Logo

Problem Solving Through Programming In C NPTEL Week 6 Solutions

This set of MCQ(multiple choice questions) focuses on the  Problem Solving Through Programming In C Week 6 Solutions.

Problem Solving Through Programming In C NPTEL Week 2 Solutions

Course layout (Answers Link)

Answers COMING SOON! Kindly Wait!

Week 0 : Assignment Week 1 :   Introduction to Problem Solving through programs Week 2 :   Arithmetic expressions, Relational Operations, Logical expressions; Introduction to Conditional Branching Week 3 :   Conditional Branching and Iterative Loops Programming Assignment Week 4 :   Arranging things : Arrays Programming Assignment Week 5 :   2-D arrays, Character Arrays and Strings   Programming Assignment Week 6 :  Basic Algorithms including Numerical Algorithms Week 7 :  Functions and Parameter Passing by Value Week 8 :  Passing Arrays to Functions, Call by Reference Programming Assignment Week 9 :  Recursion Week 10 :   Structures and Pointers Week 11 :  Self-Referential Structures and Introduction to Lists Week 12 :   Advanced Topics

NOTE:  You can check your answer immediately by clicking show answer button. Problem Solving Through Programming In C Week 6 answers ” contains 10 questions.

Now, start attempting the quiz.

Problem Solving Through Programming In C Week 6 answers

Q1. What is an array in C?

a) A collection of similar data elements with the same data type. b) A built-in function that performs mathematical calculations. c) A keyword used for declaring variables. d) A data type used to store characters only.

Answer: a) A collection of similar data elements with the same data type.

Q2. What is the index of the first element in an array?

a) 0 b) 1 c) -1 d) The index can vary depending on the array size.

Answer: a) 0

Q3. Which loop is commonly used to iterate through all elements of an array in C?

a) for loop b) while loop c) do-while loop d) switch loop

Answer: a) for loop

Q4. An integer array of 15 elements is declared in a C program. The memory location of the first byte of the array is 2000. What will be the location of the 13th element of the array? Assume int takes 2 bytes of memory.

a) 2013 b) 2024 c) 2026 d) 2030

Answer: b) 2024

Q5. How can you find the sum of all elements in a 1D array “arr” with 5 elements using loop in C?

a) sum = arr[0] + arr[1] + arr[2] + arr[3] + arr[4] b) sum = arr[5] c) for(int i=0; i<=5; i++) { sum += arr[i]; } d) for(int i=0; i<5; i++) { sum += arr[i]; }

Q6. What is the output of the following code?

a) 1 3 5 b) 1 2 3 4 5 c) 1 2 3 d) 1 4

Answer: a) 1 3 5

Q7. What will be the output?

a) i=5, j=5, k=2 b) i=6, j=5, k=3 c) i=6, j=4, k=2 d) i=5, j=4, k=2

Answer: a) i=5, j=5, k=2

Q8. What will be the output after execution of the program?

a) 1 b) 2 c) 3 d) 4

Answer: d) 4

Q9. What will be the output?

Q10. Find the output of the following C program.

a) 5, 4 b) 5, 5 c) 4, 4 d) 3, 4

Answer: c) 4, 4

Q1. What is the right way to initialise an array in C?

a) int arr{} = {1,2,5,6,9} b) int arr[5] = {1,2,5,6,9} c) int arr{5} = {1,2,5,6,9} d) int arr() = {1,2,5,6,9}

Answer: b) int arr[5] = {1,2,5,6,9}

Q2. An integer array of dimension 10 is declared in a C program. The memory location of the first byte of the array is 1000. What will be the location of the 9th element of the array?

a) 1028 b) 1032 c) 1024 d) 1036

Answer: b) 1032

Q3. What will be the output after execution of the program?

Answer: a) 1

Q4. Which of the statements is/are correct?

a) An array may contain more than one element b) All elements of array have to be of same data type c) The size of array has to be declared upfront d) All of the above

Answer: d) All of the above

Q5. What actually gets passed when you pass an array as an argument to a function

a) Value of elements in array b) First element of the array c) Base address of the array d) Address of the last element of array

Answer: c) Base address of the array

Q6. Find the output of the following C program

a) 5 b) 6 c) 9 d) 10

Answer: c) 9

Q8. An array of the void data type

a) can store any data-type b) only stores element of similar data type to first element c) acquires the data type with the highest precision in it d) It is not possible have an array of void data type

Answer: d) It is not possible have an array of void data type

Q10. How many ‘a’ will be printed when the following code is executed?

Previous Course – Week 6 assignment answers

Q1. Which of the following is correct statement to access 5th element in a array arr[] of size 50?

a) arr[5] b) arr[4] c) arr{5} d) arr{4}

Answer: b) arr[4]

Q2. Which statement is correct?

a) An index or subscript in array is a positive integer b) An index or subscript in array is a positive or negative integer c) An index or subscript in array is a real number d) none of the above statement are correct

Answer: a) An index or subscript in array is a positive integer

Q3. What is the output of C Program?

a) 20 12 14 b) 10 20 14 c) 10 12 20 d) Compiler error

Answer: b) 10 20 14

Q4. An integer array (An integer takes two bytes of memory) of size 15 is declared in a C program. The memory location of the first byte of the array is 2000. What will be the location of the 13th element of the array?

Q5. To compare two arrays, we can do it by using

a) comparison operator ‘==’ directly on arrays b) ‘ switch case’ c) ‘for’ loop d) ‘ternary operator’ on arrays

Answer: c) ‘for’ loop

Q6. How many ‘a’ will be printed when the following code is executed?

Q7. What is the output of the following C program?

a) 3 b) 4 c) No output d) Compilation error

Answer: d) Compilation error

Q8. What will be printed after execution of the following code?

a) Garbage value b) 0 c) 5 d) 6

Answer: b) 0

Q9. What is the output of the following C code?

a) 1 followed by two garbage values b) 1 1 1 c) 1 0 0 d) 0 0 0

Answer: c) 1 0 0

Q10. What will be the output when the following code is executed.

a) IIT KGP b) IIT MADRAS c) Compilation error d) Nothing is printed

Answer: b) IIT MADRAS

<< Prev – An Introduction to Programming Through C Week 5 Solutions

>> Next- An Introduction to Programming Through C Week 7 Solutions

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Related Posts

Html mcq : html basics (multiple choice question), html mcq : html web browsers (multiple choice question).

Preprocessor Directives

C programming MCQ : Preprocessor Directives(MULTIPLE CHOICE QUESTION)

C++ mcq : c++ basics(multiple choice question), leave a comment cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

  • 1st Central Law Reviews: Expert Legal Analysis & Insights

NPTEL Problem Solving Through Programming In C Assignment 6 Answers

NPTEL Problem Solving Through Programming In C Assignment 6 Answers 2022 :- In this post, We have provided answers to NPTEL Problem Solving Through Programming In C Assignment 6 week 6. We provided answers here only for reference. we urge you to do your assignment with your own knowledge.

About Problem Solving Through Programming In C

This course is aimed at enabling the students to Formulate simple algorithms for arithmetic and logical problems, Translate the algorithms to programs (in C language), Test and execute the programs and  correct syntax and logical errors, and Implement conditional branching, iteration and recursion, Decompose a problem into functions and synthesize a complete program using the divide and conquer approach. CRITERIA TO GET A CERTIFICATE This course will have an unproctored programming exam also apart from the Proctored exam, please check the announcement section for the date and time. The programming exam will have a weightage of 25% towards the Final score. Final score = Assignment score + Unproctored programming exam score + Proctored Exam score Assignment score = 25% of the average of best 8 assignments out of the total 12 assignments given in the course.  ( All assignments in a particular week will be counted towards final scoring – quizzes and programming assignments).  Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam – out of 100 Proctored Exam score =50% of the proctored certification exam score out of 100 YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF THE ASSIGNMENT SCORE >=10/25 AND UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50. If any one of the 3 criteria is not met, you will not be eligible for the certificate even if the Final score >= 40/100.

NPTEL Problem Solving Through Programming In C Assignment 6 Answers 2022

1. What is the right way to initialise an array in C? a) int ar{}= {1,2, 5,6,93 b) int ar[5]= {1,2, 5,6,9} c) int ar (5} = {1,2, 5,6,93 d) int ar)={1,2, 5,6.9

2. An integer array of dimension 10 is declared in a C program. The memory location of the first byte of the array is 1000. What will be the location of the 9th element of the array? (Assume integer takes 4 bytes of memory and the element stored at 1000 is identified as 1st element) a) 1028 b) 1032 c) 1024 d) 1036

Answers will be Uploaded Shortly and it will be Notified on Telegram, So  JOIN NOW

NPTEL Problem Solving Through Programming In C Assignment 6 Answers

3. What will be the output after execution of the program?

4. Which of the statements is/are correct? a) An array may contain more than one element b) All elements of array have to be of same data type c) The size of array has to be declared upfront d) All of the above

5. What actually gets passed when you pass an array as an argument to a function a) Value of elements in array b) First element of the array c) Base address of the array d) Address of the last element of array

6. Find the output of the following C program

👇 For Week 07 Assignment Answers 👇

7. What will be the output?

8. An array of the void data type a) can store any data-type b) only stores element of similar data type to first element c) acquires the data type with the highest precision in it d) It is not possible have an array of void data type

9. What will be the output?

10. How many ‘a’ will be printed when the following code is executed?

For More NPTEL Answers:-  CLICK HERE Join Our Telegram:-  CLICK HERE

NPTEL Problem Solving Through Programming In C Assignment 6 Answers 2021

Q1. What is the right way to initialize an array in C? 

(a) int arr{}={1,2, 5,6,9} 

(b) int arr[5]={1,2, 5,6,9} 

(c) int arr{5}={1,2, 5,6,9} 

(d) int arr()={1,2, 5,6,9}

Ans:- (b) int arr[5]={1,2, 5,6,9} 

Q2. An integer array of size 10 is declared in a C program. The memory location of the first byte of the array is 1000. What will be the location of the 8th element of the array? (Assume integer takes 4 bytes of memory and the element stored at 1000 is identified as 1st element). 

a) 1028 

b) 1032 

c) 1024 

Ans:- For Answer Click Here

Q3. What will be the output after execution of the program?

(a) 1 

(b) 2 

(c) 3 

Ans:- (a) 1

Q4. Which of the statements is correct? 

(a) an array contains more than one element 

b) All elements of array has to be of same data type 

c) The size of array has to be declared upfront 

d) All of the above

Ans:- d) All of the above

NPTEL ALL WEEK ASSIGNMENT ANSWERS:-

  • Soft Skill Assignment   Answers
  • Project Management For Managers   Answer
  • Semiconducter Devices And Circuit Answer
  • Problem Solving Through Programming In C Answer

Q5. To compare two arrays, we can do it by using 

(a) comparison operator ‘==’ directly on arrays 

(b) ‘ switch case’ 

(c) ‘for’ loop 

(d) ‘ternary operator’ on arrays

Ans:- (c) ‘for’ loop 

  • NPTEL Problem solving through Programming In C Assignment 5 Answers

Q6. Find the output of the following C Program?

(a)      5, 4 

(b)      5, 5 

(c)      4, 4 

(d)      3, 4

Ans:- (c)      4, 4 

ALSO READ : NPTEL – Online Courses,Certificate And full details

Q7. What will be the output?

(a) i=5, j=5, k=2 

(b) i=6, j=5, k=3 

(c) i=6, j=4, k=2 

(d) i=5, j=4, k=2

Ans:- (a) i=5, j=5, k=2 

Q8. Array elements are stored in memory in the following order 

(a)       Contiguous 

(b)       Random 

(c)       Both contagious and random 

(d)       None of the above

Ans:- Ans:- For Answer Click Here

Q9. What will be the output?

Q10. How many ‘a’ will be printed when following code will be executed?

NPTEL Problem solving through Programming In C Assignment 6 Answers :-  We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.

JOIN US ON YOUTUBE

  • SOFT SKILLS WEEK 7 ASSIGNMENT ANSWERS (NPTEL)
  • Project Management For Managers Assignment 6 Answers 2021
  • SOFT SKILLS WEEK 6 ASSIGNMENT ANSWERS (NPTEL)

Leave a Comment Cancel reply

You must be logged in to post a comment.

Please Enable JavaScript in your Browser to Visit this Site.

Problem Solving Through Programming in C

In this lesson, we are going to learn Problem Solving Through Programming in C. This is the first lesson while we start learning the C language.

Table of Contents

Introduction to Problem Solving Through Programming in C

Regardless of the area of the study, computer science is all about solving problems with computers. The problem that we want to solve can come from any real-world problem or perhaps even from the abstract world. We need to have a standard systematic approach to problem solving through programming in c.

computer programmers are problem solvers. In order to solve a problem on a computer, we must know how to represent the information describing the problem and determine the steps to transform the information from one representation into another.

A computer is a very powerful and versatile machine capable of performing a multitude of different tasks, yet it has no intelligence or thinking power.

The computer cannot solve the problem on its own, one has to provide step by step solutions of the problem to the computer. In fact, the task of problem-solving is not that of the computer.

It is the programmer who has to write down the solution to the problem in terms of simple operations which the computer can understand and execute.

In order to solve a problem with the computer, one has to pass through certain stages or steps. They are as follows:

Steps to Solve a Problem With the Computer

Step 1: understanding the problem:.

Here we try to understand the problem to be solved in totally. Before with the next stage or step, we should be absolutely sure about the objectives of the given problem.

Step 2: Analyzing the Problem:

The idea here is to search for an appropriate solution to the problem under consideration. The end result of this stage is a broad overview of the sequence of operations that are to be carried out to solve the given problem.

Step 3: Developing the solution:

Here, the overview of the sequence of operations that was the result of the analysis stage is expanded to form a detailed step by step solution to the problem under consideration.

Step 4: Coding and Implementation:

The vehicle for the computer solution to a problem is a set of explicit and unambiguous instructions expressed in a programming language. This set of instruction is called a program with problem solving through programming in C .

A program may also be thought of as an algorithm expressed in a programming language. an algorithm, therefore, corresponds to a solution to a problem that is independent of any programming language .

The problem solving is a skill and there are no universal approaches one can take to solving problems. Basically one must explore possible avenues to a solution one by one until she/he comes across the right path to a solution.

In general, as one gains experience in solving problems, one develops one’s own techniques and strategies, though they are often intangible. Problem-solving skills are recognized as an integral component of computer programming.

Problem Solving Steps

Problem-solving is a creative process which defines systematization and mechanization. There are a number of steps that can be taken to raise the level of one’s performance in problem-solving.

A problem-solving technique follows certain steps in finding the solution to a problem. Let us look into the steps one by one:

1. Problem Definition Phase:

In the problem definition phase, we must emphasize what must be done rather than how is it to be done. That is, we try to extract the precisely defined set of tasks from the problem statement.

Inexperienced problem solvers too often gallop ahead with the task of the problem – solving only to find that they are either solving the wrong problem or solving the wrong problem or solving just one particular problem.

2. Getting Started on a Problem:

Sometimes you do not have any idea where to begin solving a problem, even if the problem has been defined. Such block sometimes occurs because you are overly concerned with the details of the implementation even before you have completely understood or worked out a solution.

The best advice is not to get concerned with the details. Those can come later when the intricacies of the problem have been understood.

3. Use of Specific Examples:

It is usually much easier to work out the details of a solution to a specific problem because the relationship between the mechanism and the problem is more clearly defined.

This approach of focusing on a particular problem can give us the foothold we need for making a start on the solution to the general problem.

4. Similarities Among Problems:

The more experience one has the more tools and techniques one can bring to bear in tackling the given problem. But sometimes, it blocks us from discovering a desirable or better solution to the problem.

A skill that is important to try to develop in problem-solving is the ability to view a problem from a variety of angles.

5. Working Backwards from the Solution:

In some cases, we can assume that we already have the solution to the problem and then try to work backwards to the starting point. Even a guess at the solution to the problem may be enough to give us a foothold to start on the problem.

We can systematize the investigations and avoid duplicate efforts by writing down the various steps taken and explorations made.

General Problem Solving Strategies:

There are a number of general and powerful computational strategies that are repeatedly used in various guises in computer science.

Often it is possible to phrase a problem in terms of one of these strategies and achieve considerable gains in computational efficiency.

1. Divide and Conquer:

The Splitting can be carried on further so that eventually we have many sub-problems, so small that further splitting is no necessary to solve them. We shall see many examples of this strategy and discuss the gain in efficiency due to its application.

2. Binary Doubling:

This is the reverse of the divide and conquers strategy i.e build-up the solution for a larger problem from solutions and smaller sub-problems.

3. Dynamic Programming:

The travelling salesman problem falls into this category. The idea here is that a good or optimal solution to a problem can be built-up from good or optimal solutions of the sub-problems.

4. General Search, Back Tracking and Branch-and-Bound:

All of these are variants of the basic dynamic programming strategy but are equally important.

Share This Story, Choose Your Platform!

Related posts, what is preprocessor in c, what is file handling in c, structures and unions in c.

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

kg-0805/NPTEL-Problem-Solving-through-programming-in-C

Folders and files.

Course Status : Completed
Course Type : Elective
Duration : 12 weeks
Category :
Credit Points : 3
Undergraduate/Postgraduate
Start Date : 25 Jul 2022
End Date : 14 Oct 2022
Enrollment Ends : 08 Aug 2022
Exam Date : 29 Oct 2022 IST
NameName
51 Commits

Repository files navigation

Nptel - problem solving through programming in c.

Course layout

  • Week 1 : Introduction to Problem Solving through programs, Flowcharts/Pseudo codes, the compilation process, Syntax and Semantic errors, Variables and Data Types
  • Week 2 : Arithmetic expressions, Relational Operations, Logical expressions; Introduction to Conditional Branching
  • Week 3 : Conditional Branching and Iterative Loops
  • Week 4 : Arranging things : Arrays
  • Week 5 : 2-D arrays, Character Arrays and Strings
  • Week 6 : Basic Algorithms including Numerical Algorithms
  • Week 7 : Functions and Parameter Passing by Value
  • Week 8 : Passing Arrays to Functions, Call by Reference
  • Week 9 : Recursion
  • Week 10 : Structures and Pointers
  • Week 11 : Self-Referential Structures and Introduction to Lists
  • Week 12 : Advanced Topics

Course Taken Between

January 2020 to April 2020

You Can also suggest edits in the code if you feel to , just start a pull request.

  • Friday, September 6, 2024

NPTEL Problem Solving Through Programming In C WEEK 6 Assignment 2023

NPTEL Problem solving through Programming In C Week 6 All Programming Assignment Solutions

NPTEL Problem solving through Programming In C Week 6 All Programming Assignment Solutions | Swayam 2023. With the growth of Information and Communication Technology, there is a need to develop large and complex software.

ABOUT THE COURSE:

  • Formulate simple algorithms for arithmetic and logical problems
  • Translate the algorithms to programs (in C language)
  • Test and execute the programs and  correct syntax and logical errors
  • Implement conditional branching, iteration and recursion
  • Decompose a problem into functions and synthesize a complete program using divide and conquer approach
  • Use arrays, pointers and structures to formulate algorithms and programs
  • Apply programming to solve matrix addition and multiplication problems and searching and sorting problems 
  • Apply programming to solve simple numerical method problems, namely rot finding of function, differentiation of function and simple integration

COURSE LAYOUT

  • Week 1 : Introduction to Problem Solving through programs, Flowcharts/Pseudo codes, the compilation process, Syntax and Semantic errors, Variables and Data Types
  • Week 2 :  Arithmetic expressions, Relational Operations, Logical expressions; Introduction to Conditional Branching
  • Week 3 :  Conditional Branching and Iterative Loops
  • Week 4 :  Arranging things : Arrays
  • Week 5 :  2-D arrays, Character Arrays and Strings 
  • Week 6 :  Basic Algorithms including Numerical Algorithms
  • Week 7 :  Functions and Parameter Passing by Value
  • Week 8 :  Passing Arrays to Functions, Call by Reference
  • Week 9 :  Recursion
  • Week 10 :  Structures and Pointers
  • Week 11 :  Self-Referential Structures and Introduction to Lists
  • Week 12 :  Advanced Topics

Once again, thanks for your interest in our online courses and certification. Happy learning!

Course Name : “ Problem Solving through Programming In C 2023 ”

Question : 1   Write a C Program to find Largest Element of an Integer Array.  Here the number of elements in the array ‘n’ and the elements of the array is read from the test data.  Use the printf statement given below to print the largest element. printf(“Largest element = %d”, largest);

Course Name : “ Problem Solving through Programming In C ”

Question : 2   Write a C Program to print the array elements in reverse order (Not reverse sorted order. Just the last element will become first element, second last element will become second element and so on) Here the size of the array, ‘n’ and the array elements is accepted from the test case data. The last part i.e. printing the array is also written.  You have to complete the program so that it prints in the reverse order.

Question : 3  Write a C program to read Two One Dimensional Arrays of same data type (integer type) and merge them into another One Dimensional Array of same type.

Question : 4  Write a  C Program to delete an element from a specified location of an Array starting from array[0] as the 1st position, array[1] as second position and so on.

IMAGES

  1. nptel Problem solving through Programming In C Week 6 assignment

    problem solving through programming in c week 6

  2. NPTEL Problem Solving Through Programming In C WEEK 6 Assignment 2023

    problem solving through programming in c week 6

  3. Problem Solving Through Programming in C Week 6 Programming Assignment

    problem solving through programming in c week 6

  4. Problem solving through Programming In C

    problem solving through programming in c week 6

  5. Problem solving through Programming In C : NPTEL Week 6 Assignment

    problem solving through programming in c week 6

  6. NPTEL

    problem solving through programming in c week 6

VIDEO

  1. NPTEL Problem Solving through Programming In C WEEK10 Programming Assignment Solutions

  2. NPTEL Problem Solving through Programming In C WEEK11 Programming Assignment Solutions

  3. Programming in Java|| WEEK-6 Quiz assignment Answers 2023||NPTEL||#SKumarEdu

  4. NPTEL Problem Solving Through Programming In C Week-10 Quiz Assignment Solution

  5. NPTEL Problem Solving Through Programming In C Week-4 Quiz Assignment Solution

  6. Problem solving through programming in c|| week 8 assignment 8 answers || Nptel

COMMENTS

  1. Problem solving through Programming In C

    This course is aimed at enabling the students toFormulate simple algorithms for arithmetic and logical problems.Translate the algorithms to programs (in C la...

  2. NPTEL-Problem-Solving-through-programming-in-C/Week 6/6-3.c at master

    Contribute to kg-0805/NPTEL-Problem-Solving-through-programming-in-C development by creating an account on GitHub.

  3. NPTEL Problem Solving through Programming in C ASSIGNMENT 6 ANSWERS

    NPTEL | Problem Solving Through Programming In C | Week 6 : Assignment 6 | Answers with Proof | Jan 2024 Quiz SolutionsJoin Telegram Group of this course, NP...

  4. NPTEL Problem solving through Programming In C WEEK 6 ...

    🔊NPTEL Problem solving through Programming In C WEEK 6 Programming Assignment Solutions | Swayam 2022 | IIT Kharagpur🔗Code Link: https://techiestalk.in/npt...

  5. Problem Solving Through Programming In C

    Learners enrolled: 29073. ABOUT THE COURSE : This course is aimed at enabling the students to. Formulate simple algorithms for arithmetic and logical problems. Translate the algorithms to programs (in C language) Test and execute the programs and correct syntax and logical errors. Implement conditional branching, iteration and recursion.

  6. PDF Assignment 6

    03/07/2020 Problem solving through Programming In C - - Unit 8 - Week 6 https://onlinecourses.nptel.ac.in/noc20_cs06/unit?unit=7&assessment=124 3/6

  7. Problem solving through Programming In C

    Problem solving through Programming In C. ·formulate simple algorithms for arithmetic and logical problems·translate the algorithms to programs (in C language)·test and execute the programs and correct syntax and logical errors·implement conditional branching, iteration and recursion·decompose a problem into functions and synthesize a ...

  8. NPTEL :: Computer Science and Engineering

    Week 1. Lecture 1 : Introduction. Lecture 2 : Idea of Algorithms. Lecture 3 : Flow Chart and Pseudocode. Lecture 4 : Introduction to Programming Language Concepts. Lecture 5 : Variables and Memory. Week 2. Lecture 6 : Types of Software and Compilers. Lecture 7 : Introduction to C Programming Language.

  9. Problem solving through Programming in C

    Program 1 Q.Write a C Program to find Largest Element of an Integer Array. Here the number of elements in the array 'n' and the elements of the array is read from the test data. Use the printf statement given below to print the largest element. printf ("Largest element = %d", largest); Program 2 Q.Write a C Program to print the array ...

  10. Problem Solving Through Programming In C Week 6 Answers

    Get Nptel Problem Solving Through Programming In C Week 6 Answers and Solution of Assignment. All weeks solutions of this course.

  11. NPTEL Problem Solving through Programming In C WEEK6 ...

    🔊NPTEL Problem Solving through Programming In C WEEK6 Programming Assignment Solutions | Swayam 2023 | IIT Kharagpur | GATE NPTEL ⛳ABOUT THE COURSE :This co...

  12. Problem Solving Through Programming In C Week6 Assignment 2024

    Problem Solving through Programming In C Jan 2024. Program-01 : Write a C Program to find Largest Element of an Integer Array. Here the number of elements in the array 'n' and the elements of the array is read from the test data. Use the printf statement given below to print the largest element. printf ("Largest element = %d", largest);

  13. Problem Solving Through Programming in C

    Week 1 :Introduction to Problem Solving through programs, Flowcharts/Pseudo codes, the compilation process, Syntax and Semantic errors, Variables and Data Types Week 2 :Arithmetic expressions, Relational Operations, Logical expressions; Introduction to Conditional Branching Week 3 :Conditional Branching and Iterative Loops Week 4 :Arranging things : Arrays

  14. Problem Solving Through Programming in C Week 6 Programming ...

    The document provides programming assignments for finding the largest element in an integer array, printing an array in reverse order, merging two arrays into a new array, and deleting duplicate elements from an integer array. For each assignment, it provides the problem statement and requirements, and the proposed solution code in C to solve the problem, consisting of 1-2 sentences and a ...

  15. C Exercises

    This C Exercise page contains the top 30 C exercise questions with solutions that are designed for both beginners and advanced programmers. It covers all major concepts like arrays, pointers, for-loop, and many more. So, Keep it Up! Solve topic-wise C exercise questions to strengthen your weak topics.

  16. Problem Solving Through Programming In C Week 6 answers

    b) All elements of array have to be of same data type. c) The size of array has to be declared upfront. d) All of the above. Show Answer. Q5. What actually gets passed when you pass an array as an argument to a function. a) Value of elements in array. b) First element of the array.

  17. NPTEL Problem Solving Through Programming In C Week 6 Quiz ...

    🔊NPTEL Problem Solving Through Programming In C Week 6 Quiz Assignment Solution | IIT Kharagpur🔗Programming Assignment Link : https://bit.ly/3ID6gce⛳ABOUT ...

  18. NPTEL Problem Solving Through Programming In C Assignment 6 Answers

    What actually gets passed when you pass an array as an argument to a function. a) Value of elements in array. b) First element of the array. c) Base address of the array. d) Address of the last element of array. Answer:- c. 6. Find the output of the following C program. Answer:- c.

  19. Problem Solving Through Programming in C

    Table of Contents. Introduction to Problem Solving Through Programming in C. Problem Solving Through Programming in C. Steps to Solve a Problem With the Computer. Step 1: Understanding the Problem: Step 2: Analyzing the Problem: Step 3: Developing the solution: Step 4: Coding and Implementation: Problem Solving Steps.

  20. Problem Solving Through Programming in C Week 6 Assignment Solutions

    Problem Solving Through Programming in C Week 6 Assignment Solutions 2024 | @OPEducore Course: Problem Solving Through Programming in COffered by: IIT khar...

  21. kg-0805/NPTEL-Problem-Solving-through-programming-in-C

    NPTEL - Problem Solving through Programming in C. Course layout. Week 1 : Introduction to Problem Solving through programs, Flowcharts/Pseudo codes, the compilation process, Syntax and Semantic errors, Variables and Data Types. Week 2 : Arithmetic expressions, Relational Operations, Logical expressions; Introduction to Conditional Branching.

  22. NPTEL 2024 PROBLEM SOLVING THROUGH PROGRAMMING IN C WEEK 6 ...

    NPTEL 2024 PROBLEM SOLVING THROUGH PROGRAMMING IN C WEEK 6 PROGRAM 3

  23. NPTEL Problem Solving Through Programming In C WEEK 6 Assignment 2023

    Course Name : "Problem Solving through Programming In C 2023". Question : 1 Write a C Program to find Largest Element of an Integer Array. Here the number of elements in the array 'n' and the elements of the array is read from the test data. Use the printf statement given below to print the largest element.