You are on page 1of 9

College Code :

Subject :- Programming Lab C


Paper Code :-

Assignment

Student Name: …………………………………..


Roll No. : …….…………………………….

Programs on SEQUENTIAL control structure

1
Serial Programs Signature /
No. Remarks
1 Accept two numbers and display
their sum
2 Accept five numbers and display
their sum and average

3 Accept temperature in centigrade


and convert it into Fahrenheit
and display

4 Accept two numbers in location


C and D , interchange their
values and display

5 The length and breadth of a


rectangle and radius of a circle
are input through the keyboard.
Write a program to calculate the
area and perimeter of the
rectangle, and the area and
circumference of the circle.

Programs on DECISION control structure

2
Serial Programs Signature /
No. Remarks
6 Accept two numbers and display
the greater number
7 Accept three numbers and
display the greatest number

8 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. Also
determine how much profit he
made or loss he incurred.

9 An year is input through the


keyboard. Write a program to
find out whether it is a leap year
or not.

10 Any integer is input through the


keyboard. Write a program to
find out whether it is an odd
number or even number.
11 Any character is input through
the keyboard, write a program to
determine whether the character
entered is a capital letter, a small
case letter, a digit or a special
symbol.

3
Programs on LOOP control structure

Serial No. Programs Signature /


Remarks
12 Write a program to find
out the factorial value of
any number entered
through the keyboard.
13 Write a program to find
out whether the number
entered through the
keyboard is Prime or not.
14 Write a program to find
out whether the number
entered through the
keyboard is Armstrong or
not.
15 Write a program to find
out whether the number
entered through the
keyboard is Perfect or not.
16 Write a program to print
the sum of n natural
numbers
17 Write a program to print
the first n Fibonacci
numbers.
18 Write a program to
display the first n odd
numbers.
19 Write a program to accept
a number and display the
sum of its digits.
20 Write a program to print
the multiplication table of
the number entered by the
user.
21 Write a program to
produce the following
output:
*
***
*****

4
Programs on CASE control structure

Serial No. Programs Signature /


Remarks
22 Write program
that accepts two
numbers and then
displays the sum
or difference or
product or
quotient as per
user’s choice.
23 Write program
that accepts one
number and then
displays the
square of it or
cube of it as per
user’s choice.

5
Programs on user defined FUNCTIONS

Serial No. Programs Signature /


Remarks
24 Write a function that
receives 5 integers
and returns its sum
and average.
Call this function
from main ( ) and
print the results in
main( ).
25 Write a fuction that
receives one integer
and returns its sum
and average.
Call this function
from main ( ) and
print the results in
main ( ).
26 Write a function to
interchange the values
of two variables using
Call by value method.
27 Write a function to
interchange the values
of two variables using
Call by reference
method.
28 Write a function
Power(a,b) to find the value
of a raised to b.
29 Write a function factrec(n)
which calculates the
factorial of n using
recursion.

6
Programs on ARRAY

Serial No. Programs Signature /


Remarks
30 Find the standard
deviation and the
mean of 15 inputted
no.s
31 Write a program to
insert an item into a
1D array.
32 Write a program to
delete an item from a
1array.
33 Write a program to
sort an existing array
of 10 items in
ascending order.
34 Write a program to
find an item from an
array of 10 items.
35 Write a program to
add two 3*3
matrices.
36 Write a program to
multiply two 3*3
matrices.
37 Write a program to
find the transpose of
a 2D matrix.

7
Programs on STRING

Serial No. Programs Signature /


Remarks
38 Write a program to
convert an inputted
string in either upper
case or lower case
depending on user’s
choice.
39 Write a program to
count the no. of
vowels and
consonants in an
inputted string.
40 Write a program to
count the no. of
upper case, lower
case, digits and
special symbols in
an inputted string.
41 Write a program to
find out whether the
inputted string is
Palindrome or not.

8
Programs on STRUCTURE AND FILES

Serial No. Programs Signature /


Remarks
42 WAS of student database:
Input: Roll number, Name,
Dept., Course, Yoj, 10
students
Output: a) List all students
who joined in a particular
year.
b) List all students
whose courses are given.
:
43 WAS of employee
database:
Input: ACC. No.,
Name, balance, 150
employees.
Output: Find out new
balances after
deposition and
withdraw of money of
each employee.

44 WAP to read all


characters from a file
and replace all
lowercase characters by
uppercase.

45 WAP to find out size of a


file and display it on the
console.

You might also like