• Engineering & Technology
  • Computer Science
  • Computer Programming

Programming, Problem Solving, and Abstraction with C by Alistair Moffat (revised edition, Pearson, 2012)

Related documents.

Math 1090 Test 1 Review

Add this document to collection(s)

You can add this document to your study collection(s)

Add this document to saved

You can add this document to your saved list

Suggest us how to improve StudyLib

(For complaints, use another form )

Input it if you want to receive answer

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 and c programming pdf

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 and c programming pdf

DOWNLOAD APP

problem solving and c programming pdf

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, improve your coding skills with practice.

 alt=

What kind of Experience do you want to share?

IMAGES

  1. (PDF) C Programming for Problem Solving

    problem solving and c programming pdf

  2. Download Problem Solving & C Programming PDF Online by Dr. Manisha Bharambe

    problem solving and c programming pdf

  3. Download Problem Solving & C Programming PDF Online by Dr. Manisha Bharambe

    problem solving and c programming pdf

  4. Buy Problem Solving and Programming in C book : RS Salaria , 9382609490

    problem solving and c programming pdf

  5. Programming and Problem Solving with C++

    problem solving and c programming pdf

  6. JNTUK R20 1-2 Programming for Problem Solving using C Notes

    problem solving and c programming pdf

COMMENTS

  1. PDF Programming for problem solving using C Notes Unit

    Programming for problem solving using C Notes Unit - I are Programming Languages: Low- level and High-level Languages, Program Design Tools: Algorithm, Flowchart, Pseudo code. Introduction to C Programming: Introduction, Structure of a C Progra

  2. PDF Programming and Problem Solving Using C

    Algorithms for Problem Solving 7 3. Program Design and Implementation Issues 17 4. Programming Environment 25 5. Overview of C Language 32 6. Data Types, Variables, and Constants 43 7. Operators, Type Modifiers and Expressions 53 8. Basic Input/Output 68 9. Control Constructs 78 10. Arrays 104 11. Functions 123 12. Pointers 146 13. Structures 171

  3. PDF Problem Solving And Program Design In C

    Problem Solving And Program Design In C - 7th Edition.pdf Cannot retrieve latest commit at this time.

  4. PDF Programming Problem Solving And Abstraction With C

    The hallmarks of this book are the focus on problem solving and program design. This book carefully presents object-oriented programming by balancing it with procedural programming so the reader does not overlook the fundamentals of algorithm organization and design.

  5. PDF Microsoft Word

    Overview Computer programming is not just programming language syntax and using a development environment. At its core, computer programming is solving problems. We will now turn our attention to a structured methodology you can use to construct solutions for a given problem.

  6. PDF Programming for Problem Solving

    Course Objectives To understand the various steps in Program development. To understand the basic concepts in C Programming Language. To learn how to write modular and readable C Programs To learn to write programs (using structured programming approach) in C to solve problems.

  7. PDF Introduction to Problem Solving Using C

    Module I Introduction to Computers - Characteristics of Computers, Uses of computers, Types and generations of Computers - Basic Computer Organization -Modules of a computer - Planning the Computer Program - Debugging, Types of errors - Documentation - Techniques of Problem Solving - Problem solving aspects - Top- Down aspects - Implementation of algorithms - Program verification ...

  8. Problem solving and program design in C

    by Hanly, Jeri R Publication date 1993 Topics C (Computer program language) Publisher Reading, Mass. : Addison-Wesley Pub. Co. Collection internetarchivebooks; printdisabled Contributor Internet Archive Language English Item Size 1498246787 xviii, 729, [52] p. : 24 cm. + Includes index

  9. Programming, Problem Solving, and Abstraction with C by Alistair Moffat

    Programming, Problem Solving, and Abstraction with C by Alistair Moffat (revised edition, Pearson, 2012) advertisement Contents Preface vii 1 Computers and Programs 1.1 Computers and computation 1.2 Programs and programming

  10. Problem Solving and Program Design in C, Global Edition

    Problem Solving and Program Design in C teaches introductory students to program with ANSI-C, a standardized, industrial-strength programming language known for its power and probability. The text uses widely accepted software engineering methods to teach students to design cohesive, adaptable, and reusable program solution modules with ANSI-C.

  11. PROBLEM SOLVING WITH C

    PROBLEM SOLVING WITH C. This self-readable and student-friendly text provides a strong programming foundation to solve problems with C language through its well-supported structured programming methodology, rich set of operators and data types. It is designed to help students build efficient and compact programs.

  12. PDF Programming for Problem Solving Digital Notes

    PROGRAMMING FOR PROBLEM SOLVING USING C COURSE OBJECTIVES: The students will be able to 1. Understand the use of computer system in problem solving and to build program logic with algorithms and flowcharts. 2. Explain the features and constructs of C programming such as data types, expressionsLoops, arrays, strings and pointers 3.

  13. PDF Introduction to problem solving

    Specify the problem requirements. Describe the problem completely and unambiguously. Analyze the problem requirements. Identify (a) inputs, (b) the data to work with, (c) outputs (i.e. desired results). Design the algorithm to solve the problem. Write the step-by-step procedures required to solve the problem.

  14. PDF An Introduction to Computer Science and Problem Solving

    This course, however, is meant to be an introduction to programming computers with an emphasis on problem solving. This is your first programming course here in the School of Computer Science at Carleton.

  15. 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 BranchingWeek 3 : Conditional Branching and Iterative LoopsWeek ...

  16. C Programming with Problem Solving

    Each chapter introduces a problem to solve, and then covers the C language constructs necessary to solve the problem.Rather than presenting a series of polished, one-step solutions to programming problems, this text seeks to lead you through the process of analyzing problems and writing programs to solve them.

  17. PDF Principles of Algorithmic Problem Solving

    research became a mind sport known as competitive programming. As a sport algorithmic problem solving rose in popularity with the largest competitions attracting tens of thousands of programmers. While its mathematical coun-terpart has a rich literature, there are only a few books on algorithms with a strong problem solving focus.

  18. Problem solving using C : structured programing techniques

    1999 Topics C (Computer program language) Publisher Boston : WCB/McGraw-Hill Collection internetarchivebooks; inlibrary; printdisabled Contributor Internet Archive Language English Item Size 1278380122 xxi, 750 p. : 23 cm. + System requirements for accompanying computer disk: IBM PC or compatible, with Microsoft Windows 3.1 or higher and C ...

  19. PDF Unit 2 Problems Solving Using Programming Language

    C is used for developing computer applications in the area of system software, utility software such as device driver, network programming, databade systems, and many other areas of applications software. You may take this unit as beginning of learning a programming language.

  20. PDF CS18000: Problem Solving And Object-Oriented Programming

    What is Problem solving and OO programming? Problem solving and OO programming refers to a set of activities that allow the mapping of a problem to a computer program, written in an object-oriented language, that when executed on a computer will solves the problem.

  21. PDF Programming for Problem Solving Digital Notes B.tech (I Year Ii Sem

    To formulate simple algorithms for arithmetic and logical problems. To translate the algorithms to programs (in C language). To test and execute the programs and correct syntax and logical errors. Ability to apply solving and logical skills to programming in C language and also in other languages. Introduction to Computing:

  22. C Exercises

    C Exercises for Beginners and Advances: Level up your C programming skills step-by-step with hands-on practice questions. Practice and learn syntax, loops, functions, and more through rewarding C programming exercises.

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