Semester II Practicals List

1
Andhra Pradesh Common Core Syllabus SRI KRISHNADEVARAYA UNIVERSITY : ANANTHAPURAMU COMPUTER SCIENCE Common to B.ScfCS/IT) Under CBCS With Effect From Academic Year 2015-2016 LAB assignments I-YEAR - SEMESTER - I I - PROGRAMMING IN C Note: Choose two from each unit for lab and rest of programs are optional exercises 1. Write a program to demonstrate the use of printf statement to print values of variables of different data types. 2. Write a program to perform addition, subtraction, division, integer division, multiplication, and modulo division on two integer numbers. 3. Write a program to show the use of relational operators. 4. Write a program to illustrate the use of unary prefix increment and decrement operators. 5. Write a program two find the largest of three numbers using ternary operator. 6. Write a program that displays the size of every data type. 7. Write a program to determine the character entered by the user. 8. Write a program to find whether a given year is a leap year or not. 9. A company decides to give bonus to all its employees on Diwali. A 5% bonus on salary is given to the male workers and 10% bonus on salary to the female workers. Write a program to enter the salary and sex of the employee. If the salary of the employee is less than Rs 10,000 then the employee gets an extra 2% bonus on salary. Calculate the bonus that has to be given to the employee and display the salary that the employee will get. 10. Write a program to enter a number from 1-7 and display the corresponding day of the week using switch case statement ] 1. Write a program to calculate the sum of numbers from m to n. 12. Write a program using do-while loop to display the square and cube of first n natural numbers. 13. Write a program to print the multiplication table of n, where n is entered by the user. 14. Write a program using for loop to calculate factorial of a number. 15. Write a program to calculate area of a circle using function. 16. Write a program to print the Fibonacci series using recursion. 17. Write a program to read and display n numbers using an array. 18. Write a program to input two m ¥ n matrices and then calculate the sum of their corresponding elements and store it in a third m ¥ n matrix. 19. Write a program to reverse the given string. 20. Write a program to read a sentence. Then count the number of words in the sentence. 21. Write a function to swap the value of two variables. 22. Write a program to read and display the information of all the students in the class. 23. Write a program to read the details of a student and then print it on the screen as well as write it into a file. 24. Write a program to read a file character by character, and display it simultaneously on the screen. OTE: Lab Experiments can be added by the faculty and department if required.

description

dfasdfa

Transcript of Semester II Practicals List

Page 1: Semester II Practicals List

Andhra Pradesh Common Core Syllabus S R I K R I S H N A D E V A R A Y A U N I V E R S I T Y : ANANTHAPURAMU

C O M P U T E R S C I E N C E Common to B.ScfCS/IT)

Under C B C S With Effect From Academic Year 2015-2016 L A B assignments

I - Y E A R - S E M E S T E R - I I - P R O G R A M M I N G IN C

Note: Choose two from each unit for lab and rest of programs are optional exercises

1. Write a program to demonstrate the use of printf statement to print values of variables of different data types. 2. Write a program to perform addition, subtraction, division, integer division, multiplication,

and modulo division on two integer numbers. 3. Write a program to show the use of relational operators.

4. Write a program to illustrate the use of unary prefix increment and decrement operators. 5. Write a program two find the largest of three numbers using ternary operator. 6. Write a program that displays the size of every data type.

7. Write a program to determine the character entered by the user. 8. Write a program to find whether a given year is a leap year or not. 9. A company decides to give bonus to all its employees on Diwali. A 5% bonus on salary is given to the male workers and 10% bonus on salary to the female workers. Write a program to enter the salary and sex of the employee. I f the salary of the employee is less than Rs 10,000 then the employee gets an extra 2% bonus on salary. Calculate the bonus that has to be given to the employee and display the salary that the employee will get. 10. Write a program to enter a number from 1-7 and display the corresponding day of the week using switch case statement ] 1. Write a program to calculate the sum of numbers from m to n. 12. Write a program using do-while loop to display the square and cube of first n natural

numbers. 13. Write a program to print the multiplication table of n, where n is entered by the user. 14. Write a program using for loop to calculate factorial of a number. 15. Write a program to calculate area of a circle using function. 16. Write a program to print the Fibonacci series using recursion. 17. Write a program to read and display n numbers using an array. 18. Write a program to input two m ¥ n matrices and then calculate the sum of their corresponding elements and store it in a third m ¥ n matrix. 19. Write a program to reverse the given string. 20. Write a program to read a sentence. Then count the number of words in the sentence. 21. Write a function to swap the value of two variables. 22. Write a program to read and display the information of all the students in the class. 23. Write a program to read the details of a student and then print it on the screen as well as write it into a file. 24. Write a program to read a file character by character, and display it simultaneously on the screen.

OTE: Lab Experiments can be added by the faculty and department if required.