XYZ COLLEGE NAME
BHOPAL
DEPARTMENT OF
LAB MANUAL
Program : Master of Computer Application
Semester : First Semester
Course Code : MCA 103
Subject Name : Programming and problem solving in C
Prepared By:
(Lecturer)
Xyz College name
BHOPAL
DEPARTMENT OF MCA
LAB MANUAL
Program : Master of Computer Application
Semester : First Semester
Course Code : MCA 103
Subject Name : programming and problem solving in C
Prepared By:
XYZ (Lecturer)
CONTENTS
1. SYLLABUS
2. LIST OF BOOKS
3. TIME TABLE
4. PRACTICAL LIST
5. VIVA QUESSTION
6. ATTENDANCE SHEET
7. GRADING SHEET
8. LAB MANUAL
SYLLABUS
Hrs / P Hrs / Theory Marks / Sessional Marks / Practical Marks / Total Marks
Max / Min / Max / Min / Max / Min
MCA-103 / Programming and Problem Solving in C / 3 / 1 / - / 100 / 40 / 50 / 30 / - / - / 150
UNIT-I
An overview: Problem identification, analysis, design, coding, testing & debugging, implementation, modification & maintenance; algorithms & flowcharts; Characteristics of a good program - accuracy, simplicity, robustness, portability, minimum resource & time requirement, modularization; Rules/ conventions of coding, documentation, naming variables; Top down design; Bottom-up design.
UNIT-II
Fundamentals of C Programming: History of C; Structure of a C Program; Data types; Constant & Variable, naming variables; Operators & expressions; Control Constructs – if-else, for, while, do-while; Case switch statement; Arrays; Formatted & unformatted I/O; Type modifiers & storage classes; Ternary operator; Type conversion & type casting; Priority & associativity of operators.
UNIT-III
Modular Programming: Functions; Arguments; Return value; Parameter passing – call by value, call by
reference; Return statement; Scope, visibility and life-time rules for various types of variable, static variable; Calling a function; Recursion – basics, comparison with iteration, types of recursion- direct, indirect, tree and tail recursion, when to avoid recursion, examples.
UNIT-IV
Advanced Programming Techniques: Special constructs – Break, continue, exit(), goto & labels; Pointers - & and * operators, pointer expression, pointer arithmetic, dynamic memory management functions like malloc(), calloc(), free(); String; Pointer v/s array; Pointer to pointer; Array of pointer & its limitation; Function returning pointers; Pointer to function, Function as parameter; Structure – basic, declaration, membership operator, pointer to structure, referential operator, self referential structures, structure within structure, array in structure, array of structures; Union – basic, declaration; Enumerated data type; Typedef; command line arguments.
UNIT-V
Miscellaneous Features: File handling and related functions; printf & scanf family;C preprocessor – basics, #Include, #define, #undef, conditional compilation directive like #if, #else, #elif, #endif, #ifdef and #ifndef; Variable argument list functions.
LIST OF BOOKS
1 / Gottfried / Problem Solving in C / Schaum Series
2 / Kanetkar / Pointer In C / BPB
3 / Kanetkar / Let us C / BPB
4 / Schildt / C: The Complete reference / 4th ed TMH
5 / Kerninghan & Ritchie / The C programming language / PHI
XYZ COLLEGE, BHOPAL
DEPARTMENT OF MCA
LAB ASSIGNMENTS NO 1,2
Branch/Semester: MCA-I Session: July-December,2008
Subject: Programming & Problem Solving in C Subject Code: MCA 106
Name : ______Roll No.______
S. No. / Topics / Questions / Remark / Signature1.
2.
3.
4.
5.
6.
7.
8.
9.
10. / 1.Input/
output statements
2. Control statements / To calculate simple interest.
To print the table of given number.
To program of Prime number.
To print Fibonacci series.
To find LCM of 2 numbers.
To find the sum of 2 matrix.
To convert lower case to upper case.
To print number in reverse order.
To generate the following series
S= 1+ x/ 1! + x2 / 2! ------xn/n!
To check whether number is Armstrong.
To convert binary number into decimal number.
To use switch case statement into two number and then program following function :
1. Addition 2. Substration 3. Division 4. Multiplication
1.
2.
3.
4.
5.
6.
7.
8.
9.
10. / 1. Array
2. Functions
call by value
3. Recursion / To calculate factorial using function.
To fall a string using function.
To sort 10 numbers using array & function
To find the sum of two matrix using function.
To print greatest and smallest number in array.
To print this pyramid using function.
1
212
32123
To sum of even number between 1 to 100.
To swap two values using call by reference.
To calculate sum of series using recursion.
To perform the matrix multiplication.
To convert square matrix into unit matrix.
To perform transpose of given square matrix.
To perform row sum and column sum of matrix.
To perform one function is called by another function.
XYZ COLLEGE, BHOPAL
DEPARTMENT OF MCA
LAB ASSIGNMENTS NO - 3
Branch/Semester: MCA-I Session: July-December,xyz
Subject: Programming & Problem Solving in C Subject Code: MCA 106
Name : ______Roll No.______
S. No. / Topics / Questions / Remark / Signature1.
2.
3.
4.
5.
6.
7.
8.
9.
10. / Break;
Continue;
Goto;
Pointer
Structure
Union / Write a Program to demonstrate the use of break, continue and goto label .
Write a program using pointer to read a one dimensional array with 10 numbers and display them.
Write a program to read a line of lower case text character by keyboard and store it in char array .Now convert this line of text into upper case letters.
Write a program to sort the array of strings. &
Write a program to calculate the length of string without using strlen function.
Write a program to copy the contents of one string into another without using library function.
Use structure to store data about 10 books . In your program data about book entails book title ,price and number of copies of the book after reading the data about books ,your program should display the data of all the books which cost more than rs 200.
Write a C program that reads several different records. Each record is a collection of roll number and marks. Your program should rearrange in the descending order of marks and hence show the merit list.
Write a program using pointers to read an array of integer and print its element in reverse order of index.
To compute the sum and multiplication of two complex numbers (by passing a structure to a function).
Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing.
Typical output should be:
The word is "the".
The sentence is "the cat sat on the mat".
The word occurs 2 times.
XYZ COLLEGE, BHOPAL
DEPARTMENT OF MCA
LAB ASSIGNMENTS NO - 3
Branch/Semester: MCA-I Session: July-December,2008
Subject: Programming & Problem Solving in C Subject Code: MCA 106
Name : ______Roll No.______
S. No. / Topics / Questions / Remark / Signature1.
2.
3.
4.
5.
6.
7.
8.
9.
10. / Break;
Continue;
Goto;
Pointer
Structure
Union / Write a Program to demonstrate the use of break, continue and goto label .
Write a program using pointer to read a one dimensional array with 10 numbers and display them.
Write a program to read a line of lower case text character by keyboard and store it in char array .Now convert this line of text into upper case letters.
Write a program to sort the array of strings. &
Write a program to calculate the length of string without using strlen function.
Write a program to copy the contents of one string into another without using library function.
Use structure to store data about 10 books . In your program data about book entails book title ,price and number of copies of the book after reading the data about books ,your program should display the data of all the books which cost more than rs 200.
Write a C program that reads several different records. Each record is a collection of roll number and marks. Your program should rearrange in the descending order of marks and hence show the merit list.
Write a program using pointers to read an array of integer and print its element in reverse order of index.
To compute the sum and multiplication of two complex numbers (by passing a structure to a function).
Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing.
Typical output should be:
The word is "the".
The sentence is "the cat sat on the mat".
The word occurs 2 times.