Programming for Problem Solving (B.Tech 1st Semester) PDF
Document Details
Uploaded by PrudentAccordion
Gandhinagar Institute of Technology
Tags
Summary
This document is a syllabus for a programming course, likely for a first-year undergraduate computer science program. It covers various aspects of C programming, including data structures such as arrays and strings, pointer manipulation, dynamic memory allocation, and file management. Topics are presented in a structured manner with learning objectives, hours allocated for lectures and practical, and references for further study. The syllabus seems suitable for a university-level course.
Full Transcript
GANDHINAGAR INSTITUTE OF TECHNOLOGY B.TECH 1st SEMESTER CE/IT/CSE/ICT/CS/AI/EC/EE DOC NO: 4061 Subject Code: Subject Title...
GANDHINAGAR INSTITUTE OF TECHNOLOGY B.TECH 1st SEMESTER CE/IT/CSE/ICT/CS/AI/EC/EE DOC NO: 4061 Subject Code: Subject Title: Programming for Problem Solving Pre-requisite: - Nil Course Objective: 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. To provide complete knowledge of C language Teaching Scheme (Hours per week) Evaluation Scheme (Marks) Theory Practical Lecture Tutorial Practical Credit University Continuous University Continuous Total Assessment Assessment Assessment Assessment 3 0 2 4 70 30 30 20 150 Subject Contents Sr. IEEE Total Weight No Topic BLENDED Hours (%) Introduction: Basic block diagram and functions of various components of computer, Concepts of Hardware and software, 1 3 5 Types of software, Compiler and interpreter, Concepts of IEEE Machine level, Assembly level and high level programming, Flowcharts and Algorithms NPTEL, CH.1: RB.1 Fundamentals: Introduction to C, structure of C Program, comments, header files, data types, constants, variables, declarations, expression statements, arithmetic operations, 2 IEEE 4 10 unary operations, relational and logical, conditional, library functions, single character input and output, entering and writing data, Evaluation of expressions, type conversion, precedence and associativity, I/O functions. CH.1: RB.1 Control structure in C: Simple statements, Decision making 3 statements,Looping statements, Nesting of control structures, IEEE 5 10 break and continue, The Case control structure switch and goto statement. NPTEL, CH.5: RB.1 Array & String: Concepts of array, processing an array, 4 declaration and initialization of arrays, passing arrays to 5 10 IEEE function, multidimensional array, string, string storage, Built-in string functions, command line arguments. NPTEL, CH.8: RB.1 Functions: Concepts of user defined functions, prototypes, 5 definition of function, parameters, parameter passing, calling a 8 25 IEEE function, recursive function: different way of solving problems, recursive program for finding factorial, fibonacci series etc. NPTEL, CH.9: RB.1 6 Pointers: Basics of pointers, pointer to pointer, pointer and 6 15 IEEE array, pointer to array, array to pointer, function returning pointer NPTEL, CH.13: RB.1 Structure: Basics of structure, structure members, accessing 7 structure members, nested structures, array of structures, IEEE 6 15 structure and functions, structures and pointers NPTEL, CH.13: RB.1 Dynamic memory allocation and File management: 8 Introduction to Dynamic memory allocation, malloc, calloc. IEEE 8 10 Introduction to file management and its functions NPTEL, CH.12: RB.1 Course Outcome(COs): After completion of this course, student will be able to Write a C program using correct syntax and execute it. Write programs using conditional, branching, iteration, and recursion. Write programs using array and strings. Decompose a problem into function. Develop an application using the concepts of array, pointer,structure, and file management to solve engineering /scientific problems. List of References: 1. Programming in ANSI C, Balagurusamy, 8 Edition 2018 MCGraw Hill 2. Lets C, Y. Kanitkar, BPB 3. Programming with C, Gottafried, Schaum Series 4. C The Complete Reference, Scholdt, TMH 5. Structured Programming Approach Using C, B. Forouzen, Thomas Open e-Resource: 1. NPTEL C Programming: https://nptel.ac.in/courses/106104128 2. NPTEL Problem Solving through C: https://onlinecourses.nptel.ac.in/noc22_cs101/preview List of Suggested Experiments: 1. Write a program that performs as a calculator (addition, multiplication, division, subtraction). 2. Write a C program to interchange two numbers. 3. Write a program to read three numbers from the keyboard and find out the maximum out of these three. 4. Write a program to read marks from keyboard and your program should display equivalent grade according to following table(switch case) Marks Grade 100 - 80 Distinction 79 - 60 First Class 59 - 40 Second Class < 40 Fail 5. a. Write a C program to input an integer number and check if the last digit of the number is even or odd. b. Write a C program to find the factorial of a given number. c. Write a program to reverse a number. d. Write a program to generate the first n number of Fibonacci series. 6. a. Write a C program to find the sum and average of different numbers which are accepted by the user as many as the user wants. b. Write a program to check whether the given number is prime or not. 7. Write a C program to find 1+1/2+1/3+1/4+…+1/n. 8. Write a program to print following patterns: * * 12345 ** ** 1234 *** *** 123 **** **** 12 ***** ***** 1 9. a. Write a program to find maximum element from 1-Dimensional array b. Write a program to sort given array in ascending order (Use Insertion sort, Bubble sort, Selection sort, Merge sort) 10. a. Write a program to find a character from a given string. b. Write a program to reverse the string. c. Write a program to convert string into upper case. 11. Write a program to find the factorial of a number using recursion. 12. Define a structure called cricket that will describe the following information: Player name Team name Batting average Using cricket, declare an array player with 50 elements and write a C program to read the information about all the 50 players and print team wise list containing names of players with their batting average. 13. Write a C program to swap the two values using pointers.