PPS Programs All Weeks
PPS Programs All Weeks
PPS Programs All Weeks
1. Devise an Algorithm and draw flowgortihm to Print content & lines of content on screen.
2. Devise an Algorithm and draw flowgortihm to find sum of 2 integer numbers.
3. Devise an Algorithm and draw flowgortihm to perform addition of two numbers without
using +operator.
4. Devise an Algorithm and draw flowgortihm to find average of 2 float numbers.
5. Devise an Algorithm and draw flowgortihm to find reminder for given two numbers.
6. Devise an Algorithm and draw flowgortihm to find quotient for given two numbers.
7. Devise an Algorithm and draw flowgortihm to find division of 1 integer 1 float numbers.
8. Devise an Algorithm and draw flowgortihm to find the sum of natural numbers 1 to n.
(read n as input)
Hint:Use formula sum=n(n+1)/2
9. Devise an Algorithm to calculate Simple interest (SI=PTR/100)
10. Devise an Algorithm to calculate area and perimeter of a rectangle.
Area=l*b Perimeter=2* (l+b)
11. Devise an Algorithm to read the consumer number and number of units consumed and the
cost per unit and print the amount to be paid. (Amt=num of units*cost)
12. Devise an Algorithm to find the gross salary of the employee.
(read Basic, Da,Hra and pf is 10% of the basic)
13. Devise an Algorithm to read five Subject marks and find the average.
14. Devise an Algorithm to Swap two Numbers Using Temporary Variable.
15. Devise an Algorithm to Swap Numbers without Using Temporary Variable.
WEEK-2
Programs on Basic data types
13. Write a C program to calculate the angle of a rectangle if two angle are given as input.
(a+b+c=180)
14. Write a C program to read the consumer number and number of units consumed and the
cost per unit and print the amount to be paid.
(Amt=num of units*cost)
15. Write a C program to find addition of two numbers using subtraction operator.
Sum=a-(-b)
16. Write a C program to read a character, and two integer numbers and print the ASCII
value of the given character, find quotient and remainder of two given integer numbers.
17. Write a C Program to calculate area and perimeter of a triangle.
Perimeter=(a+b+c)
s=(a+b+c)/2
Area=sqrt(s*(s-a)(s-b)*(s-c))
18. Write a C program to read five Subject marks and find the average.
19. Write a C Write a program to read the values of x, y and z and print
the results of the following expressions in one line.
1. (x+y+z) / (x-y-z)
2. (x+y+z) / 3
3. (x+y) * (x-y) * (y-z)
WEEK-4
Programs on if-else statements
1. Write a C program to find the given number is even or odd.
2. Write a C program to find largest of the three given number.
3. Write a C program to find whether given number is positive or negative or zero.
4. Write a C program to find all roots (real and equal, imaginary, equal roots of a quadratic
equation).
5. Write a C program to find the given two numbers are equal or less than the other or
greater than the other.
6. Write a C program to find the whether the given number is divisible by 5 or not.
7. Write a C program to whether given year leap year or not.
8. Write a program to read three integer values from the keyboard and displays the output
stating that they are the sides of right-angled triangle
x=a*a and y=b*b and z=c*c
if(a>b&&a>c&&(x==y+ z)) or if(b>a&&b>c&&(y== x+ z)) or
if(c>a&&c>b&&z==x+y)
9. Write a C program to find whether the person is eligible to vote or not
10. Write a C program to check whether given character is alphabet, digit or special
character.
11. Write a C program to check whether given number is divisible by 5 and 11 or not.
12. An electricity board charges the following rates for the use of electricity:
For the first 200 units: 80 per unit
For the next 100 units: 90per unit
Beyond 300 units: Rs.1.00 per unit
All users are charged a minimum of Rs. 100 as meter charge. If the total amount is more
than Rs.400, then an additional surcharge of 15% of total amount is charged. Write a
program to read the name of user and number of units consumed and print out the charges
with names.
13. Write a C program to find the smallest the three given numbers.
14. Write a C program to check whether triangle is valid or not if angles are given.
15. Write a C program to check whether given character vowel or constant
16. Admission to a professional course is subjects to the following conditions:
(a) Marks in Mathematics>=60
(b) Marks in Physics>=50
(c) Marks in Chemistry>=40
(d) Total in all three subjects>=200 or Total in Mathematics and Physics>=150
Given the marks in the three subjects, write a program to process the applications to list
the eligible candidates.
17. Write a C program to find whether given number is even or odd without using else
18. Write a C program to find whether given triangle is scalene or isosceles or equilateral.
19. Write a C program to grades of a student if the marks are given between 0 and 100.
20. A set of two linear equations with two unknowns x1 and x2 is given below: ax1 +bx2=m
and cx1+dx2=n The set has unique solution x1 and x2 provided the determinate ad-cb is
not equal to zero. Write a program that will read the values of constants a,b,c,d,m and n
and compute the values of x1 and x2 .The message ”the value is infinity” should be
printed if ad-cb=0.
x1=(m*d-b*n)/(a*d-c*b); x2=(n*a-m*c)/(a*d-c*b);
WEEK-5
Programs on repetitive statements
1. Write a C Program to find the Sum of Series sum=1 + 1/2 + 1/3 + 1/4 + … + 1/N.
2. Write a C program to generate the pattern
*
* *
* * *
1
1 2
1 2 3
1 2 3 4
10. Write a C Program to find the Sum of Series sum=1 + 1/2! + 1/3! + 1/4 !+ … + 1/N!.
11. Write a C program to generate pattern.
1
232
34543
4567654
567898765
12. Write a C Program to find the sum of series 1^2 + 2^2 + …. + n^2.
13. Write a C program to generate pattern
*
*A*
*A*A*
*A*A*A*
14. Write a C Program to find the sum of series sum=1^3 + 2^3 + …. + n^3
15. Write a C Program to find the sum of series sum=1/2-3/4+5/6-7/8........up to nth term
WEEK-7
Programs on 1-D Arrays
1. Write a C program to print the repeated elements with frequency count in an
array.
2. Write a C Program to find largest and smallest element in an array.
3. Write a C Program to find the number of non repeated elements in an array.
4. Write a C Program to find 2nd largest and 2nd smallest element in an array.
5. Write a C Program to put odd and even elements of given arrays into two separate
arrays.
6. Write a C Program to find sum and average of all elements in an array.
7. Write a C Program to copy the elements of one array to another array.
8. Write a C Program to merge two arrays into third array
9. Write a C Program to search for an element in the given array.
10. Write a C Program to insert an element in a specified position in the given array.
11. Write a C Program to delete specific element from the given array.
12. Write a C Program to cyclically permute the elements of the array.
13. Write a C Program to sort the elements of the array.
14. Write a C Program to swap every pair of elements in the given array.
15. Write a C program to calculate the fraction of positive numbers, negative numbers
and zeros in the given array.
WEEK-8
Programs on 2-D Arrays
1. Write a C Program to print diagonal elements of given matrix
2. Write a C Program to find transpose of a given matrix.
3. Write a C Program to find whether given matrix is symmetric or not.
4. Write a C Program to calculate the sum of elements of each row in given matrix
using functions.
5. Write a C Program to calculate the sum of elements of each column in given
matrix using functions.
6. Write a C program to find sum of main and opposite diagonal elements of a
matrix using functions.
7. Write a C program to print lower triangular matrix
8. Write a C program to print upper triangular matrix
9. Write a C Program to find multiplication of two matrices.
10. Write a C Program to find addition of two matrices using functions.
11. Write a C Program to find subtraction of two matrices using functions.
12. Write a C Program to check whether two given matrices are equal or not.
13. Write a C Program to check whether given matrix is identity matrix or not.
14. Write a C program to find trace and normal of a given matrix.
15. Write a C program to interchange two diagonals of a given matrix.
WEEK-9
Programs on non recursive functions
1. Write a C Program to insert a sub string into main string at a given position.
2. Write a C Program to delete n characters from given string from the given
position.
3. Write a C Program to check whether given string is palindrome or not.
4. Write a C Program to check the sub string is present in the main string or not. If it
present return the position otherwise return -1 .
5. Write a C program to count number of vowels, consonants, digits and special
characters in a given string.
6. Write a C program to check two strings are equal or not without using strcmp()
function
7. Write a C program to concatenate two strings without using strcat() function.
8. Write a C program to find the length of the given string without using built in
function.
9. Write a C program to replace lowercase characters by uppercase and uppercase
characters by lowercase in the given string.
10. Write a C program to count number of lines, words and characters in the given
text.
11. Write a C Program to remove all Characters in a String except alphabet.
12. Write a C Program for Return maximum occurring character in the input string.
13. Write a C Program for Print reverse of a string using recursion.
14. Write a C Program to reverse words in a given string.
15. Write a C program to copy the content of one string to another without using
strcpy() function.
WEEK-12
Programs on Pointers and Structures
1. Write a C program to read the elements of 1-d array using pointers and print them in
reverse order using pointers.
2. Write a C Program to read two elements dynamically using malloc() function and
interchange the two numbers using call by reference.
3. Write a C Program to read and print the elements of 1-D array using calloc() memory
allocation function and reallocate memory for the array by increasing the size of the
array, read and print the elements of reallocated array.
4. Write a C Program to read and print elements of 1-D array using calloc() memory
allocation function.
5. Write a C Program to print 2-D array using pointers.
6. Write a C program to store name, roll number, year and marks of three subjects of n
students and print the student the name, roll number, average and grade based on average
marks of the student using structures.
7. Write a C Program to read real and imaginary parts of a complex number using structures
and perform the following operations on complex numbers.
Add two complex numbers.
Multiply two complex numbers.
Subtract two complex numbers.
8. Write a C Program to read time in hours, minutes, seconds using structures and perform
the following operations on time.
Addition of two time periods
Subtraction of two time periods
9. Write a C Program to read distance in inches and feet using structures and perform the
following operations
Add two distances
Subtract two distances
10. Write a C program to read employee details employee number, employee name, basic
salary, hra and da of n employees using structures and print employee number, employee
name and gross salary of n employees.
11. Write C program that can be used to read item details used in party and calculate all
expenses, divide expenses in all friends equally using structures.
12. Write a C Program to Create a structure to specify data on students given below: Roll
number, Name, Department, Course, Year of joining
(a) Write a function to print names of all students who joined in a particular year.
(b) Write a function to print the data of a student whose roll number is given.
13. Write a C Program to Create a structure to specify data of customers in a bank. The data to
be stored is: Account number, Name, Balance in account.
(a) Write a function to print the Account number and name of each customer with balance
below Rs. 100.
(b) If a customer request for withdrawal or deposit, it is given in the form: Acct. no, amount,
code (1 for deposit, 0 for withdrawal)
14. There is a structure called employee that holds information like employee code, name, date
of joining. Write a C Program to create an array of the structure and enter some data into it.
Then ask the user to enter current date. Display the names of those employees whose tenure
is 3 or more than 3 years according to the given current date.
15. Write a C Program that compares two given dates. To store date use structure say date that
contains three members namely date, month and year. If the dates are equal then display
message as "Equal" otherwise "Unequal".
WEEK-13
Programs on Files