[PDF] COMPUTER PROGRAMMING LAB MANUAL





Previous PDF Next PDF



COMPUTER PROGRAMMING LAB MANUAL

COMPUTER PROGRAMMING LABORATORY. (Common for CSE / ECE / EEE / IT). Semester: I. Course Code. IA16-A1502. Hours / Week. Credits. Maximum Marks. Category.



COMPUTER SCIENCE AND ENGINEERING

5 CSL 332 NETWORKING LAB Apply. 40. 40. 40. Analyze. Evaluate. Create. 5. COMPUTER SCIENCE AND ... Programming Language to Use in Lab : Ansi C.



JAVA PROGRAMMING LAB MANUAL Computer Science and

To educate students to become effective problem solvers apply knowledge with social sensitivity for the betterment of the society and humanity as a whole.



OPERATING SYSTEMS LABORATORY MANUAL B.TECH (R18) (II

Identify the purpose of different software applications. Week 1: Simulate the following CPU scheduling algorithms. a) FCFS b) SJF c) Round Robin.



emester V Course Hand-Out

KTU B.TECH. - SEMESTER V An ability to take up research problems and apply computer science principles to ... CS333 Application Software Development Lab.



KTU Syllabus for S1 and S2

Web: ktu.edu.in Graphing parametric curves and surfaces using software ... To apply the principles of mechanics to practical engineering problems.



Mobile Application Development Lab MALLA REDDY COLLEGE OF

6 janv. 2018 Tech Computer Science and Engineering the graduates will have the following Program Specific Outcomes: 1. Fundamentals and critical knowledge ...



Programming in C Lab Manual EST 102

PROGRAM OUTCOMES (POs):. Engineering Graduates will be able to: 1. Engineering knowledge: Apply the knowledge of mathematics science



ILAHIA COLLEGE OF ENGINEERINGG & TECHNOLOGY Mulavoor

CS 333 APPLICATION SOFTWARE DEVELOPMENT LAB MANUAL CSE V Sem. ASDL Lab. DOMAIN INTEGRITY. Example: Create table cust(custid number(6) not null ...



database management systems laboratory manual b.tech (ii year – ii

and oral forms towards the development of database applications Extra-programs ... To use SQL you need not to require any programming experience.

1

COMPUTER PROGRAMMING

LAB MANUAL

Year :

2016 - 2017

Subject Code : ACS101

Regulations :

R16

Class : I B.Tech II Semester

Branch : AE /

ME / CE

Prepared by

Ms. B Padmaja Associate Professor, CSE

Ms. G Geetha Ms. S Swarajya Laxmi

Assistant Professor, CSE Associate Professor, CSE

COMPUTER SCIENCE AND ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING

(Autonomous)

Dundigal, Hyderabad - 500 043

2

INSTITUTE OF AERONAUTICAL ENGINEERING

(Autonomous)

Dundigal, Hyderabad - 500 043

COMPUTER SCIENCE AND ENGINEERING

Program Outcomes

PO1 Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and

an engineering specialization to the solution of complex engineering problems.

PO2 Problem analysis: Identify, formulate, review research literature, and analyze complex engineering

problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and

engineering sciences.

PO3 Design/development of solutions: Design solutions for complex engineering problems and design

system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations. PO4 Conduct investigations of complex problems: Use research-based knowledge and research methods

including design of experiments, analysis and interpretation of data, and synthesis of the information to

provide valid conclusions.

PO5 Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering

and IT tools including prediction and modeling to complex engineering activities with an understanding

of the limitations.

PO6 The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,

health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional

engineering practice.

PO7 Environment and sustainability: Understand the impact of the professional engineering solutions in

societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable

development.

PO8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the

engineering practice.

PO9 Individual and team work: Function effectively as an individual, and as a member or leader in diverse

teams, and in multidisciplinary settings.

PO10 Communication: Communicate effectively on complex engineering activities with the engineering

community and with society at large, such as, being able to comprehend and write effective reports and

design documentation, make effective presentations, and give and receive clear instructions. PO11 Project management and finance: Demonstrate knowledge and understanding of the engineering and projects and in multidisciplinary environments.

PO12 Life-long learning: Recognize the need for, and have the preparation and ability to engage in

independent and life-long learning in the broadest context of technological change. 3

Program Specific Outcomes

PSO1 Professional Skills: The ability to research, understand and implement computer programs in the areas

related to algorithms, system software, multimedia, web design, big data analytics, and networking for

efficient analysis and design of computer-based systems of varying complexity.

PSO2 Problem-Solving Skills: The ability to apply standard practices and strategies in software project

development using open-ended programming environments to deliver a quality product for business success.

PSO3 Successful Career and Entrepreneurship: The ability to employ modern computer languages,

environments, and platforms in creating innovative career paths, to be an entrepreneur, and a zest for

higher studies.

COMPUTER PROGRAMMING LAB SYLLABUS

SOFTWARE AND HARDWARE REQUIREMENTS FOR A BATCH OF 60 STUDENTS:

HARDWARE:

Desktop systems: 30 nos

Printers: 02

SOFTWARE:

System Software: Windows 7.

Application Software: MS Office.

Programming Languages: Dev C++

4

COMPUTER PROGRAMMING LABORATORY

(Common for CSE / ECE / EEE / IT)

Semester: I

Course Code IA16-A1502

Hours / Week

Credits Maximum Marks

Category Foundation L T P C CI

E SEE Total

- - 3 2 30 70 100

Goal: This course helps the students in understanding a powerful, portable and flexible structured programming

language which is suitable for both systems and applications programming. It is a robust language which contains

a rich set of built-in functions and operators to write any complex program.

Objectives:

The course should enable the students to:

I. Develop modular, efficient and readable C programs by hands-on experience.

II. Interpret good profound knowledge in C programming language and enable them to build programs using operators,

control structures, arrays, strings, functions, pointers and structures to solve the real world problems.

III. Illustrate memory allocation to variables dynamically and perform operations on text and binary files.

IV. Develop interest and lay foundation to learn data structures and Java programming languages and excel as a

professional programmer.

LIST OF EXPERIMENTS

Week-1 OPERATORS AND EVALUATION OF EXPRESSIONS

a. Write a C program to check whether a number is even or odd using ternary operator. b. Write a C program to perform the addition of two numbers without using + operator.

c. Write a C program to evaluate the arithmetic expression ((a + b / c * d - e) * (f - g)). Read the values a, b, c, d, e, f, g

from the standard input device. d. Write a C program to find the sum of individual digits of a 3 digit number.

e. Write a C program to read the values of x and y and print the results of the following expressions in one line:

i. (x + y) / (x - y) ii. (x + y)(x - y)

Week-2 CONTROL STRUCTURES

a. Write a C program to find the sum of individual digits of a positive integer.

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

sequence.

c. Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user.

d. A character is entered through keyboard. Write a C program to determine whether the character entered is a capital

letter, a small case letter, a digit or a special symbol using if-else and switch case. The following table shows the range

5 of ASCII values for various characters.

Characters ASCII values

A Z 65 90

a z 97 122

0 9 48 57

Special symbols 0 47, 58 64, 91 96, 123 127

e. If cost price and selling price of an item is input through the keyboard, write a program to determine whether the seller

has made profit or incurred loss. Write a C program to determine how much profit or loss incurred in percentage.

Week-3 CONTROL STRUCTURES

a. Write a C program, which takes two integer operands and one operator from the user, performs the operation and then

prints the result. (Consider the operators +, -, *, /, % and use switch statement). b. Write a C program to calculate the following sum: sum = 1 x2 /2! + x4 /4! x6 /6! +x8 /8! x10/10! c. Write a C program to find the roots of a quadratic equation. d. Write a C program to check whether a given 3 digit number is Armstrong number or not. e. Write a C program to print the numbers in triangular form 1 1 2

1 2 3

1 2 3 4

Week-4 ARRAYS

a. Write a C program to find the second largest integer in a list of integers. b. Write a C program to perform the following: i. Addition of two matrices ii. Multiplication of two matrices c. Write a C program to count and display positive, negative, odd and even numbers in an array. d. Write a C program to merge two sorted arrays into another array in a sorted order. e. Write a C program to find the frequency of a particular number in a list of integers.

Week-5 STRINGS

a. Write a C program that uses functions to perform the following operations: i. To insert a sub string into a given main string from a given position. ii. To delete n characters from a given position in a given string. b. Write a C program to determine if the given string is a palindrome or not. c. Write a C program to find a string within a sentence and replace it with another string. d. Write a C program that reads a line of text and counts all occurrence of a particular word.

e. Write a C program that displays the position or index in the string S where the string T begins, or 1 if S

6

Week-6 FUNCTIONS

a. Write C programs that use both recursive and non-recursive functions i. To find the factorial of a given integer. ii. To find the greatest common divisor of two given integers. b. Write C programs that use both recursive and non-recursive functions i. To print Fibonacci series. ii. To solve towers of Hanoi problem. c. Write a C program to print the transpose of a given matrix using function. d. Write a C program that uses a function to reverse a given string.

Week-7 POINTERS

a. Write a C program to concatenate two strings using pointers. b. Write a C program to find the length of string using pointers. c. Write a C program to compare two strings using pointers. d. Write a C program to copy a string from source to destination using pointers. e. Write a C program to reverse a string using pointers.

Week-8 STRUCTURES AND UNIONS

a. Write a C program that uses functions to perform the following operations: i. Reading a complex number ii. Writing a complex number iii. Addition and subtraction of two complex numbers iv. Multiplication of two complex numbers. Note: represent complex number using a structure. b. Write a C program to compute the monthly pay of 100 em

computed as 52% of the basic pay. Gross-salary (basic pay + DA). Print the employees name and gross salary.

c. Create a Book structure containing book_id, title, author name and price. Write a C program to pass a structure as a

function argument and print the book details.

d. Create a union containing 6 strings: name, home_address, hostel_address, city, state and zip. Write a C program to

display your present address.

e. Write a C program to define a structure named DOB, which contains name, day, month and year. Using the concept

of nested structures display your name and date of birth.

Week-9 ADDITIONAL PROGRAMS

a. Write a C program to read in two numbers, x and n, and then compute the sum of this geometric progression:

1+x+x2+x3n . For example: if n is 3 and x is 5, then the program computes 1+5+25+125. Print x, n, the

sum. Perform error checking. For example, the formula does not make sense for negative exponents if n is less than

0. Have your program print an error message if n<0, then go back and read in the next pair of numbers of without

computing the sum. Are any values of x also illegal? If so, test for them too. b. menting all the bits after the first 7 number.

c. Write a C program to convert a Roman numeral to its decimal equivalent. E.g. Roman number CD is equivalent to

400.

Week-10 PREPROCESSOR DIRECTIVES

a. Define a macro with one parameter to compute the volume of a sphere. Write a C program using this macro to

compute the volume for spheres of radius 5, 10 and 15 meters.

b. Define a macro that receives an array and the number of elements in the array as arguments. Write a C program for

using this macro to print the elements of the array.

c. Write symbolic constants for the binary arithmetic operators +, -, *, and /. Write a C program to illustrate the use of

these symbolic constants.

Week-11 FILES

a. Write a C program to display the contents of a file. b. Write a C program to copy the contents of one file to another. c. Write a C program to reverse the first n characters in a file, where n is given by the user.

d. Two files DATA1 and DATA2 contain sorted lists of integers. Write a C program to merge the contents of two files

into a third file DATA i.e., the contents of the first file followed by those of the second are put in the third file.

e. Write a C program to count the no. of characters present in the file.

Week-12 COMMAND LINE ARGUMENTS

a. Write a C program to read arguments at the command line and display it.

b. Write a C program to read two numbers at the command line and perform arithmetic operations on it.

c. Write a C program to read a file name at the command line and display its contents.

Total Contact Hours: Nil Total Tutorials: Nil

Total Practical Classes:

36 Total Hours: 36

Reference Books:

1. th Edition, 2012.

2. rd Edition, 1997.

3. nd Edition, 2015.

4. A Complete Introduction to the C Programming

Publishers, 3rd Edition, 2004.

5. st Edition, 1994.

Web References:

1. www.sanfoundry.com/c-programming-examples

2. www.geeksforgeeks.org/c

3. www.cprogramming.com/tutorial/c

4. www.cs.princeton.edu

8

WEEK-1

OPERATORS AND EVALUATION OF EXPRESSIONS

1.1 OBJECTIVE:

1. Write a C program to check whether a number is even or odd using ternary operator.

2. Write a C program to perform the addition of two numbers without using + operator.

3. Write a C program to evaluate the arithmetic expression ((a + b / c * d - e) * (f - g)).

Read the values a, b, c, d, e, f, g from the standard input device.

4. Write a C program to find the sum of individual digits of a 3 digit number.

5. Write a C program to read the values of x and y and print the results of the following

expressions in one line: iii. (x + y) / (x - y) iv. (x + y)(x - y)

1.2 RESOURCES:

Dev C++ 5.11

1.3 PROGRAM LOGIC:

To check whether a number is even or odd using ternary operator

1. Start

2. Read n

3. (n%2==0 ? "EVEN" : "ODD")

4. Display EVEN if n%2==0

5. Otherwise ODD

6. Stop

To perform the addition of two numbers without using + operator

1. Start

2. Read a,b

3. sum = a - ~b -1

4. Display the value of sum

5. Stop

9 To evaluate the arithmetic expression ((a + b / c * d - e) * (f - g)).

1. Start

2. Read a,b,c,d,e,f,g

3. A=a+b

4. B=A/c

5. C=(d-e)

6. D=(f-g)

7. Calculate B*C*D

8. Store B*C*D value to Result

9. Display the Result

To find the sum of individual digits of a 3 digit number.

1. Start

2. Read a number N

3. Initialize the Sum=0

4. if n > 0 then calculate reminder R= N %10

5. Add reminder R to Sum

6. Store N/10 value to N

7. If N=0 then Display Sum

8. Stop

To read the values of x and y and print the results of the following expressions in one line i. (x + y) / (x - y) ii. (x + y)(x - y) i. (x + y) / (x - y)

1. Start

2. Read numbers x and y

3. A=x+y

4. B=x-y

5. Perform A/B

6. Store the value of A/B in Result

7. Display the Result

ii. (x + y)(x - y)

1. Start

2. Read numbers x and y

10

3. A=x+y

4. B=x-y

5. Perform A*B

6. Store the value of A*B in Result

7. Display the Result

1.4 PROCEDURE:

1. Create: open Dev C++ 5.11 write a program after that save the program with .C extension.

2. Compile: F9

3. Execute: F10

1.5 SOURCE CODE:

To check whether a number is even or odd using ternary operator #include int main() int n; printf("\n enter the values of n:"); scanf("%d",&n); (n%2)?printf("odd") : printf("even"); return 0; To perform the addition of two numbers without using + operator #include int main() int a,b,c; printf("\n enter the values of a,b:"); scanf("%d%d",&a,&b); c=(a-~b)-1; printf("sum=%d",c); return 0; 11 To evaluate the arithmetic expression ((a + b / c * d - e) * (f - g)). #include int main() int a,b,c,d,e,f,g,res; printf("\n enter the values of a,b,c,d,e,f,g:"); res=((a+b/c*d-e)*(f-g)); printf("res=%d",res); return 0; To find the sum of Individual digits of a 3 digit number #include int main() int n,d1,d2,d3; printf("\n enter the values of 3 digit no:"); scanf("%d",&n); d1=n%10; n=n/10; d2=n%10; n=n/10; d3=n%10; n=n/10; n=d1+d2+d3; printf("the sum of individual number=%d",n); To read the values of x and y and print the results of the following expressions in one line i. (x + y) / (x - y) ii. (x + y)(x - y) i. (x + y) / (x - y) #include void main() int x,y,A,B; 12 float Result; printf("Enter the values of x,y\n"); scanf("%d %d " ,&x, &y);

A=(x+y);

B=(x-y);

Result=A/B ;

printf("%f", Result); ii. (x + y)(x - y) #include void main() int x,y,A,B; float Result; printf("Enter the values of x,y\n"); scanf("%d %d " ,&x, &y);

A=(x+y);

B=(x-y);

Result=A*B ;

printf("%f", Result);

1.6 INPUT/OUTPUT

To check whether a number is even or odd using ternary operator 13 To perform the addition of two numbers without using + operator To evaluate the arithmetic expression ((a + b / c * d - e) * (f - g)). 14 To find the sum of Individual digits of a 3 digit number To read the values of x and y and print the results of the following expressions in one line

1.7 PRE LAB VIVA QUESTIONS:

1. Who is the father of C language?

2. Which operator takes only integer operands?

15

3. C programs are converted into machine languge with the help of

a. An editor b. A compiler c. An operating system d. None

4. C was primarily developed as

a. System programming language b. General purpose language c. Data processing language d. None

5. How many keywords are recognized by standard ANSI C?

6. Why variable names beginning with underscore is not encouraged?

7. In C programming language, which of the following types of operators will have highest

precedence a. Relational operators b. Equality operators c. Logical operators d. Arithmetic operators

8. If i,j,k are integer variables with values 1,2 3 respectively, then what is the value of the

expression !((j+k) > (i+5)?

9. Arrange these operators ., | |, <, =, if arranged in ascending order of precedence?

10.

1.8 LAB ASSIGNMENT:

1. Find the output of the following code?

void main() int i=10; i = !i > 14; pr

2. Find the output of the following code?

void main() int i=0, j=1, k=2,m; m = i++ || j++ || k++;

3. Find the output of the following code?

void main() int main=3; 16

4. Find the output of the following code?

void main() int k;

5. Find the output of the following code?

void main() \rcollege\

6. Find the output of the following code?

void main() int const k = 5; k++;

7. Find the output of the following code?

int x; void main() if (x) printf("hi"); else printf("how are u");

8. Find the output of the following code?

void main() int x = 0; if (x == 0) printf("hi"); else printf("how are u"); printf("hello");

9. Find the output of the following code?

void main() int x = 5; if (x < 1);quotesdbs_dbs14.pdfusesText_20
[PDF] application software examples

[PDF] application software notes

[PDF] application surjective injective et bijective

[PDF] application to commissioner for police verification

[PDF] application to commissioner of police for noc format

[PDF] application to commissioner/ superintendent of police for noc

[PDF] application to deputy commissioner for permission

[PDF] application to police commissioner for character certificate

[PDF] application to police commissioner for noc

[PDF] applications and applied mathematics an int. j

[PDF] applications and decisions 2019

[PDF] applications and decisions east

[PDF] applications and decisions north east

[PDF] applications and decisions north west

[PDF] applications and decisions northern ireland