Steps of Learning @ Temple of Knowledge

Click here to edit subtitle

                                                   COMPUTER PROGRAMMING



VIVEKANANDAREDDY P

Assistant Professor,

Department of computer science
TEEGALA KRISHNAREDDY ENGINEERING COLLEGE








R13 B.Tech I Year syllabus
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
I Year B.Tech.








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.

To introduce the students to basic data structures such as lists, stacks and queues.
To make the student understand simple sorting and searching methods.
Outcomes:
UNIT - I
Introduction to Computers – Computer Systems, Computing Environments, Computer Languages, Creating and
running programs, Program Development.
Introduction to the C Language – Background, C Programs, Identifiers, Types, Variables, Constants, Input / Output,
Operators(Arithmetic, relational, logical, bitwise etc.), Expressions, Precedence and Associativity, Expression
Evaluation, Type conversions, Statements- Selection Statements(making decisions) – if and switch statements,
Repetition statements ( loops)-while, for, do-while statements, Loop examples, other statements related to looping –
break, continue, goto, Simple C Program examples.
UNIT - II
Functions-Designing Structured Programs, Functions, user defined functions, inter function communication, Standard
functions, Scope, Storage classes-auto, register, static, extern, scope rules, type qualifiers, recursion- recursive
functions, Limitations of recursion, example C programs, Preprocessor commands.
Arrays – Concepts, using arrays in C, inter function communication, array applications, two – dimensional arrays,
multidimensional arrays, C program examples.
UNIT - III
Pointers – Introduction (Basic Concepts), Pointers for inter function communication, pointers to pointers, compatibility,
Pointer Applications-Arrays and Pointers, Pointer Arithmetic and arrays, Passing an array to a function, memory
allocation functions, array of pointers, programming applications, pointers to void, pointers to functions.
Strings – Concepts, C Strings, String Input / Output functions, arrays of strings, string manipulation functions, string /
data conversion, C program examples.
UNIT - IV
Enumerated, Structure ,and Union Types– The Type Definition(typedef), Enumerated types, Structures –Declaration,
initialization, accessing structures, operations on structures, Complex structures, structures and functions, Passing
structures through pointers, self referential structures, unions, bit fields, C programming examples, command –line
arguments,
Input and Output – Concept of a file, streams, text files and binary files, Differences between text and binary files,
State of a file, Opening and Closing files, file input / output functions (standard library input / output functions for
files), file status functions (error handling),Positioning functions, C program examples.
UNIT – V
Searching and Sorting – Sorting- selection sort, bubble sort, Searching-linear and binary search methods.
Lists- Linear list – singly linked list implementation, insertion, deletion and searching operations on linear list, Stacks-
Push and Pop Operations, Queues- Enqueue and Dequeue operations.
TEXT BOOKS:
1. Computer Science: A Structured Programming Approach Using C, B.A.Forouzan and R.F. Gilberg, Third
Edition, Cengage Learning.
2. Programming in C. P. Dey and M Ghosh , Oxford University Press.
11R13 B.Tech I Year syllabus
REFERENCE BOOKS:
1. C& Data structures – P. Padmanabham, Third Edition, B.S. Publications.
2. C for All, S. Thamarai Selvi, R.Murugesan, Anuradha Publications.
th
3. Problem Solving and Program Design in C, J.R. Hanly and E.B. Koffman, 7
Edition, Pearson education.
4. Programming in C, Ajay Mittal, Pearson.
rd
5. Programming with C, B.Gottfried, 3 edition, Schaum’s outlines, TMH.
6. Problem solving with C, M.T.Somasekhara, PHI
7. Programming with C, R.S.Bickar, Universities Press.
th
8. Computer Programming & Data Structures, E.Balagurusamy, 4 edition, TMH.
9. Programming in C – Stephen G. Kochan, III Edition, Pearson Education.
10. The C Programming Language, B.W. Kernighan and Dennis M.Ritchie, PHI.
11. C Programming with problem solving, J.A. Jones & K. Harrow,Dreamtech Press.





 C COPY OF FILES



#include <stdio.h>

#include <stdlib.h>

int main()

{

char ch, source_file[20], target_file[20];

FILE *source, *target;

printf("Enter name of file to copy\n");

gets(source_file);

source = fopen(source_file, "r");

if( source == NULL )

{

printf("Press any key to exit...\n");

exit(EXIT_FAILURE);

}

printf("Enter name of target file\n");

gets(target_file);

target = fopen(target_file, "w");

if( target == NULL )

{

fclose(source);

printf("Press any key to exit...\n");

exit(EXIT_FAILURE);

}

while( ( ch = fgetc(source) ) != EOF )

fputc(ch, target);

printf("File copied successfully.\n");

fclose(source);

fclose(target);

return 0;

}