C PROGRAMMING LAB (R13)

C PROGRAMMING LAB

Exercise l
a) Write a C Program to calculate the area of triangle using the formula area
 = ( s (s-a) (s-b)(s-c))1/2 where s= (a+b+c)/2
b) Write a C program to find the largest of three numbers using ternary operator.
c) Write a C Program to swap two numbers without using a temporary variable.
Exercise 2
 a) 2s complement of a number is obtained by scanning it from right to left and complementing all the bits after the first appearance of a 1. Thus 2s complement of 11100 is 00100. Write a C program to find the 2s complement of a binary number.
b) Write a C program to find the roots of a quadratic equation.
c) Write a C program, which takes two integer operands and one operator form the user, performs the operation and then prints the result. (Consider the operators +,-,*, /, % and use Switch Statement)
Exercise 3
a) Write a C program to find the sum of individual digits of a positive integer and find the reverse of the given number.
b) A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Write a C program to generate the first n terms of the sequenceUse the summing series method to compute the value of SIN(x),COS(x) and e x.
c) Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user.
Exercise 4
a) Write a C Program to print the multiplication table of a given number n up to a given value, where n is entered by the user.
b) Write a C Program to enter a decimal number, and calculate and display the binary equivalent of that number.
c) Write a C Program to check whether the given number is Armstrong number or not.
Exercise 5
a) Write a C program to interchange the largest and smallest numbers in the array.
b) Write a C program to implement a liner search.
c) Write a C program to implement binary search
Exercise 6
a) Write a C program to implement sorting of an array of elements .
b) Write a C program to input two m x n matrices, check the compatibility and perform addition and multiplication of them
Exercise 7 Write a C program that uses functions to perform the following operations:
i. To insert a sub-string in to given main string from a given position.
ii. To delete n Characters from a given position in a given string.
iii. To replace a character of string either from beginning or ending or at a specified location
Exercise 8
Write a C program that uses functions to perform the following operations using Structure:
i)                   Reading a complex number
ii)                 Writing a complex number
iii)               Addition of two complex numbers
iv)               Multiplication of two complex numbers
Exercise 9
a)     Write C Programs for the following string operations without using the built in functions - to concatenate two strings - to append a string to another string - to compare two strings
Exercise 10
a) Write C Programs for the following string operations without using the built in functions - to find t he length of a string - to find whether a given string is palindrome or not
Exercise 11
a) Write a C functions to find both the largest and smallest number of an array of integers.
b) Write C programs illustrating call by value and call by reference cncepts.
Exercise 12
a) Write C programs that use both recursive and non-recursive functions for the following
i) To find the factorial of a given integer.
ii) To find the GCD (greatest common divisor) of two given integers.
iii) To find Fibonacci sequence
Exercise 13
a) Write C Program to reverse a string using pointers
b) Write a C Program to compare two arrays using pointers
Exercise 14
 a) Write a C program consisting of Pointer based function to exchange value of two integers using passing by address.
b) Write a C program to swap two numbers using pointers
Exercise 15 Examples which explores the use of structures, union and other user defined variables
Exercise 16
 a) Write a C program which copies one file to another.
 b) Write a C program to count the number of characters and number of lines in a file.

c) Write a C Program t merge two files into a third file. The names of the files must be entered using command line arguments.

Problem Solving And Program Design In C, 5/E By Hanly


Problem Solving and Program Design in C, Hanly, Koffman, 7th ed, PERSON


Problem Solving and Program Design in C, Jeri R. Hanly - Elliot B. Koffman, 7th Edition.pdf


Problem Solving and Program Design in C teaches a disciplined approach to  problem solving, applying widely accepted software engineering methods to design program solutions as cohesive, readable, reusable modules. We present as an implementation vehicle for these modules a subset of ANSI C—a standardized, industrial-strength programming language known for its power and portability. This text can be used for a first course in programming methods: It assumes no prior knowledge of computers or programming. The text’s broad selection of case studies and exercises allows an instructor to design an introductory   programming course in C for computer science majors or for students from a wide range of other disciplines.

To view the book CLICK HERE

 

Computer Programming R13

COMPUTER PROGRAMMING

Objectives: Formulating algorithmic solutions to problems and implementing algorithms in C

UNIT I: Unit objective: Notion of Operation of a CPU, Notion of an algorithm and computational procedure, editing and executing programs in Linux Introduction: Computer systems, Hardware and Software Concepts, Problem Solving: Algorithm / Pseudo code, flowchart, program development steps, computer languages: machine, symbolic and highlevel languages, Creating and Running Programs: Writing, Editing(vi/emacs editor), Compiling( gcc), Linking and Executing in under Linux. BASICS OF C: Structure of a c program, identifiers, basic data types and sizes. Constants, Variables, Arthmetic , relational and logical operators, increment and decrement operators, conditional operator, assignment operator, expressions, type conversions, Conditional Expressions, precedence and order of evaluation, Sample Programs. 

UNIT II: Unit objective: understanding branching, iteration and data representation using arrays SELECTION – MAKING DECISION: TWO WAY SELECTION: if-else, null else, nested if, examples, Multi-way selection: switch, else-if, examples. ITERATIVE: loops- while, do-while and for statements , break, continue, initialization and updating, event and counter controlled loops, Looping applications: Summation, powers, smallest and largest. ARRAYS: Arrays- concepts, declaration, definition, accessing elements, storing elements, Strings and String Manipulations, 1-D arrays, 2-D arrays and character arrays, string manipulations, Multidimensional arrays, array applications: Matrix operations, checking the symmetricity of a Matrix. STRINGS: concepts, c strings. 

UNIT III: Objective: Modular programming and recursive solution formulation FUNCTIONS- MODULAR PROGRAMMING: functions, basics, parameter passing, storage classes extern, auto, register, static, scope rules, block structure, user defined functions, standard library functions, recursive functions, Recursive solutions for fibonacci series, towers of Hanoi, header files, C Preprocessor, example c programs, Passing 1-D arrays, 2-D arrays to functions. 

UNIT IV: Objective: Understanding pointers and dynamic memory allocation POINTERS: pointers- concepts, initialization of pointer variables, pointers and function arguments, passing by address- dangling memory, address arithmetic, character pointers and functions, pointers to pointers, pointers and multi-dimensional arrays, dynamic memory management functions, command line arguments

UNIT V: Objective: Understanding miscellaneous aspects of C ENUMERATED, STRUCTURE AND UNION TYPES: Derived types- structures- declaration, definition and initialization of structures, accessing structures, nested structures, arrays of structures, structures and functions, pointers to structures, self referential structures, unions, typedef, bit-fields, program applications BIT-WISE OPERATORS: logical, shift, rotation, masks.

UNIT VI: Objective: Comprehension of file operations FILEHANDLING: Input and output- concept of a file, text files and binary files, Formatted I/O, File I/O operations, example programs 

Text Books:

1. Problem Solving and Program Design in C, Hanly, Koffman, 7th ed, PERSON 
2. Programming in C, Second Edition Pradip Dey and Manas Ghosh, OXFORD Higher Education 
3. Programming in C, A practical approach Ajay Mittal PEARSON 
4. The C programming Language by Dennis Richie and Brian Kernighan 

Reference Books and web links: 

1. C Programming, A Problem Solving Approach, Forouzan, Gilberg, Prasad, CENGAGE 
2. Programming with C, Bichkar, Universities Press 
3. Programming in C, Reema Thareja, OXFORD
4. C by Example, Noel Kalicharan, Cambridge

JNTUK R13 CSE Syllabus


JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY: KAKINADA
KAKINADA-533003, Andhra Pradesh (India)
COMPUTER SCIENCE AND ENGINEERING
COURSE STRUCTURE
Common Syllabus for All Branches (1-1 & 1-2 )
I YEAR                                                                                                                           I SEMISTER
S. No.
Subject
T
P
Credits
1
English – I
3+1
-
3
2
Mathematics - I
3+1
-
3
3
Engineering Chemistry
3+1
-
3
4
Engineering Mechanics
3+1
-
3
5
Computer Programming
3+1
-
3
6
Environmental Studies
3+1
-
3
7
Engineering Chemistry Laboratory
3
2
8
English - Communication Skills Lab - I
3
2
9
C Programming Lab
3
2
Total
24

I YEAR                                                                                                                         II SEMISTER
S. No.
Subject
T
P
Credits
1
English – II
3+1
-
3
2
Mathematics – II
3+1
-
3
3
Mathematical Methods
3+1
-
3
4
Engineering Physics
3+1
-
3
5
Professional Ethics and Human Values
3+1
-
3
6
Engineering Drawing
3+1
-
3
7
English - Communication Skills Lab - II
3
2
8
Engineering Physics Lab
3
2
9
Engg.Workshop & IT Workshop
3
2
Total
24

Click Here To Download PDFs     R13 Syllabus

JNTUK R10 CSE Syllabus

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY: KAKINADA
KAKINADA-533003, Andhra Pradesh (India)
COMPUTER SCIENCE AND ENGINEERING
COURSE STRUCTURE

I YEAR                                                                                                                           I SEMISTER

S. No.
Subject
T
P
Credits
1
English – I
3
-
2
2
Mathematics -  I
3
-
2
3
Engineering  Physics – I
3
-
2
4
Engineering  Chemistry I
3
-
2
5
C Programming
3
-
2
6
Mathematical Methods   
3
-
2
7
Engineering  Physics & Engineering Chemistry Laboratory -I
-
3
2
8
Engineering Workshop  (Carpentry, Fitting, House wiring, )
-
3
2
9
C Programming Lab
-
3
2
10
English Proficiency Lab
-
3
2
Total
20

I YEAR                                                                                                                         II SEMISTER
S. No.
Subject
T
P
Credits
1
English – II
3
-
2
2
Mathematics – II
3
-
2
3
Engineering Physics – II
3
-
2
4
Engineering Chemistry- II
3
-
2
5
Engineering Drawing
3
-
2
6
Environmental  Studies
3
-
2
7
Engineering  Physics & Engineering Chemistry Laboratory -II
-
3
2
8
English – Communication Skills Lab
-
3
2
9
IT Workshop
-
3
2
Total

18

II YEAR                                                                                                                                              I SEMISTER
S. No.
Subject
T
P
Credits
1
Managerial Economics and Financial Analysis
4
-
4
2
Probability & Statistics
4
-
4
3
Mathematical Foundations of Computer  Science and Engineering
4
-
4
4
Digital Logic Design
4
-
4
5
Electronic Devices And Circuits
4
-
4
6
Data Structures
4
-
4
7
Electronic Devices and Circuits Lab
-
3
2
8
Data Structures Lab
-
3
2
9
Professional Communicational skills
-
2
1
10
Professional Ethics and Morals-I
2
-
-
Total
29

II YEAR                                                                                                                                                                   II SEMISTER
S. No.
Subject
T
P
Credits
1
Software Engineering
4
-
4
2
Principles of ProgrammingLanguages
4
-
4
3
Object Oriented Programmingthrough Java
4
-
4
4
Computer Organization
4
-
4
5
Data Base Management Systems
4
-
4
6
Formal Languages and AutomataTheory
4
-
4
7
Object Oriented Programming Lab
-
3
2
8
Data Base Management Systems Lab
-
3
2
9
Professional Communicational skills
-
2
1
10
Professional Ethics and Morals-I
2
-
-
Total

29

III YEAR                                                                                                                                                                    I SEMISTER
S. No.
Subject
T
P
Credits
1
Compiler Design
4
-
4
2
Computer Networks
4
-
4
3
Micro Processors and Multicore Systems
4
-
4
4
Operating Systems
4
-
4
5
Computer Graphics
4
-
4
6
Advanced Data Structures
4
-
4
7
Operating System & Compiler Design Lab
-
3
2
8
Advanced Data Structures  Lab
-
3
2
9
IPR and Patents- 1
2
-
-
Total


28

III YEAR                                                                                                                                           II SEMISTER
S. No.
Subject
T
P
Credits
1
Advanced Computer Networks
4
-
4
2
Computer Architecture
4
-
4
3
Design and Analysis of Algorithms
4
-
4
4
UNIX Programming
4
-
4
5
Management Science
4
-
4
6
Advanced Java and Web Technologies
4
-
4
7
Computer Networks and Unix  Lab
-
3
2
8
Advanced Java and Web Technologies Lab
-
3
2
9
IPR and Patents- 2
2
-
-
Total


28

IV YEAR                                                                                                                                                                   I SEMISTER
S. No.
Subject
T
P
Credits
1
Cryptography and Network Security
4
-
4
2
UML & Design Patterns
4
-
4
3
Data Ware Housing and Data Mining
4
-
4
4
Mobile Computing
4
-
4
5
Open Elective
i. MATLAB
ii.Web Services
iii. Open Source Software
iv.Cyber Laws
4
-
4
6
Elective –I:
i. Computer Forensics
ii. Cloud Computing
iii. Software Project Management
iv. Machine Learning
v. Distributed Databases
4
-
4
7
UML & Design Patterns Lab
-
3
2
8
Mobile Application Development Lab
-
3
2
Total


28

IV YEAR                                                                                                                                                                 II SEMISTER
S. No.
Subject
T
P
Credits
1
Elective –II
i) Human Computer Interaction
ii) Advanced Operating Systems
iii)Mobile Adhoc & Sensor Networks
iv)Pattern Recognition
v) Digital Image Processing
4
-
4
2
Elective –III
i) Embedded and Real Time Systems
ii) Simulation Modeling
iii)Information  Retrieval Systems
iv) Artificial Intelligence
v) Multimedia & Application Development
4
-
4
3
Elective –IV
i) Software Testing Methodologies
ii) Neural Networks & Soft Computing
iii)Social Networks and the Semantic Web
iv) Parallel Computing
v) E- Commerce
4
-
4
4
Distributed Systems
4
-
4
5
Project
12
Total


28