List of Practicals-1
List of Practicals-1
List of Practicals-1
3. Write a program in C to show that Right shift effectively divides a number by 2 and a left
shift effectively multiplies a number by 2
5. Write down a function in C to implement bitwise AND, OR, XOR and NOT operations
6. Given a n integer number write a program that displays the number as follows
7. Write a program to enter an integer and print the sum of the digits in the integer
8. Write a C program to input an investment amount and compute its fixed deposit
commulative return after 10 years at the rate of interest of 7.75%
Gross Salary is sum of Basic salary, Perks and HRA which is 25% of Basic Salary
Write a Program that will read Employees name, Level and Basic pay and will print Gross
salary, Tax and Net Salary. Use Switch-case statement and if statements
11. Given a number, write a program using while loop to reverse the digits of the number.
For example number 12345 should be written as 54321.
12. Write a program to find the prime numbers between a range of numbers entered by the user.
13. Write a program to find the HCF of two integers entered by the user
17. Given the two one dimensional arrays A and B of size 10 which are sorted in ascending
order. Write a C program to merge them into single sorted array C that contains every
item from arrays A and B in ascending order
18. Write a program that will count the number of occurrences of a specified character in a
given line of Text.
19. Write a program to enter two 3 x 3 matrices and find their
a. sum
b. Multiplication
c. Transpose
20. Write a program that counts the number of vowels, consonants and digits in a given
line of string
21. Write a program that replaces a substring with another string in a given line of text.
22. Write a program that takes as input a line of text and counts the frequency of each digit and letter in
the input. The program will treat an uppercase letter and its lowercase equivalent as the same letter;
forexample, E and e increment the same counter.
23. Write a program that takes as input maximum 100 numbers from user (+ve integers) and calculates
(I) sum (ii) mean (iii) standard deviation and (iv) variance
25. Write a program that reads the cost of an item in the form RRR.PP(Where RRRR
represents the Rupees and PP represents Paise) and converts the value to a string of
words. e.g. if we input 125.75, the output should be “RUPEES ONE HUNDRED TWENTY
FIVE AND PAISE SEVENTY FIVE”
26. Write a program using pointers to read an array of integers and print its elements in
reverse order
27. Write a function(using pointer parameters) that compares two integer arrays to see
whether they are identical. The function returns 1 if they are identical else 0
28. Write a program that takes as input an integer and prints if the number is Prime or
Fibonicci or both. Use Functions write the program
29. Write a function substring that, given two strings s1 and s2, returns the starting position of the first
occurrence of s1 in s2. If s1 is not in s2, return -1. For example, substring("mom","thermometer") returns 4
but substring("dad","thermometer")returns -1.
30. Write a program in C using pointers to implement insertion and deletion in a queue. A
queue is a data structure that follows a first in first out i.e. the element to go in first is the
one to come out first
31. Define a structure data type called time_struct containing three members hour, minute
and second. Develop a program that will input values from the user and assign values to
the individual members and display the the time in the following format 16:40:40
32. A start-up owner is interested to maintain the dataset of the newly recruited
employees. She is interested in storing the Emp_Name (Str), Emp_Mobile(int), Emp_Age
(int), Emp_Degree (Str), Emp_Exp (Float), Emp_add (Structure). Emp_add need one user
defined data to store street no, city, district and state for the employee address. You
have to design a database where we can store all theinformation for at least 20employees.
The program should be interactive program to input the employee details and also the
program should be able to retrieve the data of an employee based on the mobile
number
33. Implement the problem 22 using Files. Read the text from a file and store the count of
letters and digits to another file
34. Write a function using pointers to add two matrices and to return the resultant matrix
to the calling function
35. The prime numbers from 1 to 2500 can be obtained as follows. From a list of the numbers 1 to 2500, cross out all
multiples of 2 (but not 2 itself). then, find the next number (n, say) that is not crossed out and cross out all
multiples ofn (but not n). repeatthislaststepprovidedthatnhasnotexceeded50(thesquarerootof2500). the
numbers remaining in the list (except 1) are prime. Write a program that uses this method to print all primes
from1to2500.storeyouroutputinafilecalled primes.out. Thismethodiscalledthesieveoferatosthenes,
namedafterthe Greek mathematician, geographer, and philosopher.
PYTHON PROGRAMS