You are on page 1of 4

Maharishi Vidya Mandir Sr.Sec.

School,Chetpet,Chennai
Half Yearly Practical Program list
1. Write a c++ program using function to search a particular element
in an array using the function lsearch(int a[],int n,int m).
2. Write a c++ program using function to find then sum of elements
in the even position of single dimensional array.
3. Write a c++ program using function to find then sum of elements
in the odd position of single dimensional array.
4. Write a c++ program using userdefined function to find whether
a given string is palindrome or not.(without using strrev()).
5. Write a c++ program using function to find the maximum element
in an array.
6. Write a c++ program using function to find the minimum element
in an array.
7. Write a c++ program using function to find the no.of words in a
given line of text.
8. Write a c++ program using function to find no.of vowels
,consonants and digits in the given string.
9. Write a c++ program using function to search a particular
character in a word using binary search method.
10.
Write a c++ program to find the sum of series
(22+(22+42)+(22+42+62)+ upto n terms)
11.
Write a c++ program using function to find the sum of
factors of the number.
12.
Write a c++ program using function to find the gcd of 2
numbers.
13.
Write a c++ program using function to read first
name,middle name,last name from the user and produce an
output where first letter of each name is capitalized.
14.
Write a C++ Program using function to pass a string as
argument and print the reverse of a string
15.
Write a C++ Program using function to pass a number as
argument and check whether the number is a prime number or
not.
16.
Write a C++ Program using function to find the sum of the
series 12+32+52+upto n terms
17.
Write a C++ program using function to accept 10 integers
from a user in a single dimensional array and find the sum of
numbers which are divisible by 5
18.
Write a C++ program using function to accept 10 integers
from a user in a single dimensional array and find the product of
numbers which are in even position.

19.

Write a C++ program using function to accept 10 integers

from a user in a single dimensional array and find the product of


numbers which are in odd position.
20.
Write a C++ program using function to accept any 5 numbers
, find the average and print the grade for that average.
90
100 O
80
89
A
70
79
B
60
69
C
50
59
D
<50
E

21.

Write a function named sumfun() with arguments n and N,

which return the sum of the following series to the main


program.
1/12+1/32+1/52+..upto nterms
22.
Write a program that read a string and a character. Each
occurrence of the given character is converted to opposite case.
For example if the string entered is:AabracadabrA and the
character as A or a then the output string should be
aAbracAdAbra see each a or A is converted to opposite case
i.e.,upper to lower or vice-versa.
23.
Write a C++ Program using function to find the sum of the
series( x-x2/3!+x3/5!-x4/7!+x5/9!-.upto nterms)
24.
Write a C++ Program to print the following pattern
A
A
A
A
A

B
B
B
B
25.

C
C
C

D
D E
Write a C++ Program using function to find the sum of the

series(1+1/1!+1/2!+1/3!+upto nterms)
26.
Write a C++ Program using function to find the even
elements in an array(A) and store them in another array(B).At the
end of the program ,prints the sum of all even elements.
27.
Write a C++ Program using function to find the odd elements
in an array(A) and store them in another array(B).At the end of
the program,prints the sum of all odd elements.
28.
Write a C++ Program to concatenate two strings without
using any predefined function.
29.
Write a C++ Program using function to calculate commission
for the sales where the sales is passed as argument to the
function. The commission is calculated according to the following
conditions:
Sales
30001 onwards

Commission rate
15%

22001-30000
10%
12001-22000
7%
5001-12000
3%
<5000
30.
Write a C++ Program using function to print the following
series
X2/2!+X4/4!+X6/6!+.upto n terms
31.
Write a C++ Program using function to print the following
series
X-X3/3!+X5/5!-X7/7!+upto n terms
32.
Write a C++ Program that reads two strings and copies the
smaller string into then bigger string.
33.
Write a C++ Program using function sum of all the
elements in the even position in single dimensional array.
34.
Write a C++ Program to print then following pattern
&&&&
&&&
&&
&
35.
Write a C++ Program using function to accept a string and
replace the occurrence of e as o and space as -.
36.
Write a C++ Program using function to accept an array of
integers and the number to be searched in the array, replace all
the occurrences of the number in the array with 0.
37.
Write a C++ Program using function to pass a number as
argument and check whether the number is a prime number or
not.
38.
Write a C++ Program using function to calculate a3+b3+c3=d3
and check whether it is satisfied or not.
39.
Write a C++ Program using function to accept a choice and
find 1.Area of Rectangle 2.Area of Square and 3.Area of Circle
using switch case ,use three different function for
rectangle,square and circle.
40.
Write a C++ program using function which accepts a integer
value as argument and to print the values of the following
pattern.
5
5 4
5 4
3
5
4
3
2
5
4
3 2
1
41.
Write a c++ program to print then following pattern
% % % % %
# # # #
% % %
# #
%
42.
Write a C++ Program using function to print the Fibonacci
series using for loop.
43.
Write a C++ Program using function to print the symbol in
the following pattern.

****
***
**
*
*
44.

Write a C++ Program using function in C++ to take a string

as an argument to display the average sentence size where each


sentence is terminated by a full stop
45.
Write a C++ Program using function in C++ using user
defined strfun()function to print the following pattern without
using strlen() function
C
Co
Com
Comp
Compu
Comput
Compute
Computer
46.
An electricity board charges according to following rates:
For first 100 units-40 P per unit(P-paise)
For next 200 units-50 P per units
Beyond 300 units-60 P per unit.
All users are charged meter charge also,whichn is Rs 50/Write a program to read the number of units consumed,and print out
the charges.
47.
Write a C++ program with user defined function that
exchanges the value of first half
6

10

12

side

elements with the

second half side elements

of the array.

7
Forexample:

10

12
48.

Write a C++ program with user defined function to accept a

string and count the number of words that starts with ' A ' or ' a '.
49.
Write a C++ program with user defined function to accept a
string and check whether the given character is present in that
string , if it is present , replace it with ' $ ' and display that string.

You might also like