Programming for Problem Solving (KCS101/KCS 201)
This blog cover all the programs and important question related to Programming for Problem Solving using C programming language.
Course Outcome ( CO) Bloom’s Knowledge Level (KL)
At the end of course , the student will be able to understand
CO 1 To develop simple algorithms for arithmetic and logical problems.
CO 2 To translate the algorithms to programs & execution (in C language).
CO 3 To implement conditional branching, iteration and recursion.
CO 4 To decompose a problem into functions and synthesize a complete program using divide and conquer approach.
CO 5 To use arrays, pointers and structures to develop algorithms and programs.
Detailed Syllabus
Unit I (Introduction to Programming)
Introduction to components of a computer system: Memory, processor, I/O Devices, storage, operating system, Concept of assembler, compiler, interpreter, loader and linker.
Idea of Algorithm: Representation of Algorithm, Flowchart, Pseudo code with examples, From algorithms to programs, source code.
Programming Basics: Structure of C program, writing and executing the first C program, Syntax and logical errors in compilation, object and executable code.
Components of C language. Standard I/O in C , Fundamental data types, Variables and memory locations, Storage classes.
2 marks important question
Long Answer Question with Answer
Most Frequently Asked Question with Answer
Unit II (Arithmetic expressions & Conditional Branching)
Arithmetic expressions and precedence : Operators and expression using numeric and relational operators, mixed operands, type conversion, logical operators, bit operations, assignment operator, operator precedence and associativity.
Conditional Branching: Applying if and switch statements, nesting if and else, use of break and default with switch.
2 marks important question
Long Answer Question with Answer
Most Frequently Asked Question with Answer
Unit III (Loops & Functions )
Iteration and loops: use of while, do while and for loops, multiple loop variables, use of break and continue statements.
Functions: Introduction, types of functions, functions with array, passing parameters to functions, call by value, call by reference, recursive functions.
2 marks important question
Long Answer Question with Answer
Most Frequently Asked Question with Answer
Unit IV (Arrays & Basic Algorithms)
Arrays: Array notation and representation, manipulating array elements, using multi dimensional arrays. Character arrays and strings, Structure, union, enumerated data types, Array of structures, Passing arrays to functions.
Basic Algorithms: Searching &Basic Sorting Algorithms (Bubble, Insertion and Selection), Finding roots of equations, Notion of order of complexity.
2 marks important question
Long Answer Question with Answer
Most Frequently Asked Question with Answer
Unit V (Pointer & File Handling )
Pointers: Introduction, declaration, applications, Introduction to dynamic memory allocation (malloc, calloc, realloc, free), Use of pointers in self-referential structures, notion of linked list (no implementation)
File handling: File I/O functions, Standard C preprocessors, defining and calling macros, command-line arguments.
2 marks important question
Long Answer Question with Answer
click here
Most Frequently Asked Question with Answer
click here
Text books:
1. Schaum’s Outline of Programming with C by Byron Gottfried , McGraw-Hill
2. The C programming by Kernighan Brain W. and Ritchie Dennis M., Pearson Education .
3. Computer Basics and C Programming by V.Rajaraman , PHI Learning Pvt. Limited, 2015.
4. Computer Concepts and Programming in C, E Balaguruswami, McGraw Hill
5. Computer Science- A Structured Programming Approach Using C, by Behrouz A. Forouzan, Richard F. Gilberg, Thomson, Third Edition , Cengage Learning – 2007.
6. Let Us C By Yashwant P. Kanetkar.
7. Problem Solving and Program Design in C, by Jeri R. Hanly, Elliot B. Koffman, Pearson Addison-Wesley, 2006.
Programming for Problem Solving Lab
Course Outcome ( CO) Bloom’s Knowledge Level (KL)
At the end of course , the student will be able to:
CO 1 Able to implement the algorithms and draw flowcharts for solving Mathematical and Engineering problems.
CO 2 Demonstrate an understanding of computer programming language concepts.
CO 3 Ability to design and develop Computer programs, analyzes, and interprets the concept of pointers, declarations, initialization, operations on pointers and their usage.
CO 4 Able to define data types and use them in simple data processing applications also he/she must be able to use the concept of array of structures.
CO 5 Develop confidence for self education and ability for life-long
learning needed for Computer language.
LAB 1 Write a program to calculate the area of triangle using formula at=√s(sa)(s-b)(s-c)
***********************
Sol: Click Here
**********************************
LAB 2 Basic salary of an employee is input through the keyboard. The DA is 25% of the basic salary while the HRA is 15% of the basic salary. Provident Fund is deducted at the rate of 10% of the gross salary (BS+DA+HRA). Program to calculate the Net Salary.
**********************
Sol: Click Here
**********************
LAB 3 Write a program to determine the roots of quadratic equation.
LAB 4 Write a program to find the largest of three numbers using nested if else.
**********************
**********************
LAB 5 Write a program to receive marks of physics, chemistry & maths from user
& check its eligibility for course if
a) Marks of physics > 40
b) Marks of chemistry > 50
c) Marks of math’s > 60
d) Total of physics & math’s marks > 150
or
e) Total of three subjects marks > 200
LAB 6 Write a program to find the value of y for a particular value of n. The a, x,
b, n is input by user
if n=1 y=ax%b
if n=2 y=ax2+b2
if n=3 y=a-bx
if n=4 y=a+x/b
LAB 7 Write a program to construct a Fibonacci series upto n terms.
LAB 8 Write a program to find whether the number is Armstrong number.
******************
******************
LAB 9 Write a program to generate sum of series 1!+2!+3!+————–n!
******************************
******************************
LAB 10 Write a program to find the sum of following series 1-X1/1!+X2/2!-…………Xn/n!.
********************
********************
LAB 11 Write a program to print the entire prime no between 1 and 300.
********************
********************
LAB 12 Write a program to print out all the Armstrong number between 100 and 500.
*****************************
*****************************
LAB 13 Write a program to draw the following figure:
3 2 1
21
1
*
**
***
*******************
******************
LAB 14 Write a program to receive a five-digit no and display as like 24689:
2
4
6
8
9
*******************
*******************
LAB 15 Write a function that return sum of all the odd digits of a given positive no entered through keyboard.
*******************
*******************
LAB 16 Write a program to print area of rectangle using function & return its value to main function.
LAB 17 Write a program to calculate the factorial for given number using function.
*******************
*******************
LAB 18 Write a program to find sum of Fibonacci series using function.
*******************
*******************
LAB 19 Write factorial function & use the function to find the sum of series S=1!+2!+—–n!.
*****************************
*****************************
LAB 20 Write a program to find the factorial of given number using recursion.
LAB 21 Write a program to find the sum of digits of a 5 digit number using recursion.
LAB 22 Write a program to calculate the GCD of given numbers using recursion.
LAB 23 Write a program to convert decimal number in to binary number.
LAB 24 Write a program to convert binary number in to decimal number.
LAB 25 Write a program to delete duplicate element in a list of 10 elements & display it on screen.
LAB 26 Write a program to merge two sorted array & no element is repeated during merging.
LAB 27 Write a program to evaluate the addition of diagonal elements of two square matrixes.
LAB 28 Write a program to find the transpose of a given matrix & check whether it is symmetric or not.
LAB 29 Write a program to print the multiplication of two N*N (Square) matrix.
LAB 30 Write a program in C to check whether the given string is a palindrome or not.
LAB 31 Write program to sort the array of character (String) in alphabetical order like STRING in GINRST.
LAB 32 Write a program to remove all the blank space from the string & print it, also count the no of characters.
LAB 33 Write a program to store the following string “zero”, “one” ——-“five”. Print the no in words, given in figure as 3205.
LAB 34 Write a program to compare two given dates. To store a date uses a structure that contains three members namely day, month and year. If the dates are equal then display message equal otherwise unequal.
LAB 35 Define a structure that can describe a hotel. It should have the member that includes the name, address, grade, room charge and number of rooms. Write a function to print out hotel of given grade in order of room charges.
LAB 36 Define a structure called cricket with player name, team name, batting average, for 50 players & 5 teams. Print team wise list contains names of player with their batting average.
LAB 37 Write a c program to copy & count the character content of one file says a.txt to another file b.txt.
LAB 38 Write a program to take 10 integers from file and write square of these integer in other file.
LAB 39 Write a program to read number from file and then write all ‘odd’ number to file ODD.txt & all even to file EVEN.txt.
LAB 40 Write a program to print all the prime number, between 1 to 100 in file prime.txt.
LAB 41 Write the following C program using pointer:
a) To sort the list of numbers through pointer
b) To reverse the string through pointer.
LAB 42 Write a program to find the largest no among 20 integers array using dynamic memory allocation.
LAB 43 Using Dynamic Memory Allocation, Write a program to find the transpose of given matrix.
LAB 44 Write a program to find the factorial of given number using command line argument.
LAB 45 Write a program to find the sum of digits of a 5 digit number using command line argument.
MOST FREQUENTY ASKED PROGAMS IN AKTU EXAM FROM PPS