Hi-Tech Computers Best Known for
(Since 1999) C/C++/JAVA/SQL
Hi-Tech Computers
Bhiwani
An ISO 9001:2008 Certified Institute
Affiliate to MDU, Rohtak
Information Centre: Swami Vivekanand Subharti University, Meerut
MCA/BCA/APGDCA/M.SC (CS)/ MBA
Take Home Assignment
Mail To @ lalithitechbhiwani@gmail.com, lalit.hitechbwn@gmail.com
All UG/PG Courses through Distance Mode
9813510824, 8685010824
1|Page Learn Java, Python, C++, SQL, etc.
Hi-Tech Computers Best Known for
(Since 1999) C/C++/JAVA/SQL
Simple Logical Problems
1. Write a C program to find out sum of digits of a given three digits number.
2. Write a program to convert the temperature from Fahrenheit to Celsius where
formula is c=(f-32)/1.8
3. Write a program to input a lower case letter and convert it to a upper case
letter.
4. Write a program to accept two integer numbers and perform all arithmetic
operations and display results accordingly.
5. Write a program to reverse a three digits number.
6. Write a program to swap two integer values.
Decision control statement using IF..Else IF ….Conditional Operator
and Switch Statement
1. Write a program to find maximum of three numbers using if else if construct.
2. Input a number and display whether number is Even or Odd and Also find
whether +VE or –VE.
3. Write a program to display number of days in the given year, also find
whether the given year is a Leap Year or not.
4. Write a program to check whether the entered alphabet is a vowel or
consonant.
5. Write a program to check whether the entered alphabet is in Capital or lower
case
6. Write a program to check whether the entered character is an alphabet or a
digit or a symbol.
Switch case
1. Write a menu based program which shows a menu as follows
a) Addition
b) Subtraction
c) Division
d) Multiplication
se) Remainder/Modulus
Now enter code to read the user’s choice and then to read two numbers and
perform arithmetic operation according to the choice given.
2. Write a menu based program which shows a menu as follows
a) Area of Object
b) Arithmetic Operation
Now enter code to read the user’s choice if user enter choice ‘a’ then again a
menu shown as below:
a) Area of Circle
b) Area of Rectangle
c) Area of Triangle
Now read user’s choice again and find the area of object according to the
given choice.
Say if user enters ‘b’ as his prime choice then again a menu is shown as
2|Page Learn Java, Python, C++, SQL, etc.
Hi-Tech Computers Best Known for
(Since 1999) C/C++/JAVA/SQL
a) Addition
b) Subtraction
c) Division
d) Multiplication
e) Remainder/Modulus
Now read user’s choice again and Display the result accordingly.
Looping Construct
1. Write a program to find sum of N natural Numbers
2. Write a program to find Sum of all even numbers upto 200.
3. Write a program to find Factorial of a given integer.
4. Write a program to evaluate Mn.
5. Write a program to evaluate mn/n!
6. Write a program to find whether a number is prime or not
7. Write a program to find whether the number is an Armstrong
number or not
8. Print all prime factors of given number
for Example say user enters 24 then output must be
24=2*2*2*3
9. Write a program to print a given number of terms of Fibonacci
series
1 1 2 3 5 8 13 ……..
10. Write a program to print all prime numbers up to 1000.
11. Write a program to print table of all numbers starting
from 2 to 20
12. Write a program to print factorial of all numbers starting
from 5 to 10
13. Print a triangle of digits as:
11
2112
321123
43211234
14. Print the following structure
A
AB
ABC
ABCD
3|Page Learn Java, Python, C++, SQL, etc.
Hi-Tech Computers Best Known for
(Since 1999) C/C++/JAVA/SQL
15. Print the triangle of digits as
a)
1
12
123
1234
12345
1234
123
12
1
b)
5
54
543
5432
54321
5432
543
54
5
c)
1
22
333
4444
55555
666666
4|Page Learn Java, Python, C++, SQL, etc.
Hi-Tech Computers Best Known for
(Since 1999) C/C++/JAVA/SQL
Arrays
1. Write a program to swap two arrays of 5 integers each.
2. Write a program to find maximum and minimum out of array of 20 elements
3. Write a program to perform following operations upon an array using menu
based mechanism.
a) Average of elements of Array
b) Sum of Elements of Array
c) Counting of elements of Array
d) Searching of elements using Linear Approach
e) Searching of elements using Binary Approach
f) Sorting of elements
Note: U have an array of size 50 where elements can be less than size
4. Write a program to split an array into 2. Say u have an array named array1 of
20 elements now write a program to read those 20 elements and create two
more arrays say array2 and array3. Array2 contains all even numbers from
array1 and array3 contains all odd numbers from array1
5. Write a program to transpose a matrix of 5x5
6. Write a program to find sum of each row and each column separately where
you have the matrix of 6x6
7. Write a program to find sum of values lying at diagonals of a square matrix.
8. Write a program to multiply two matrices of 5x5.
Strings
Note : Usage of built in functions is not allowed. Write code to perform following operations.
1. Write a program to find the length of a string.
2. Write a program to find reverse of a string.
3. Write a program to count how many words your string is carrying
4. Write a program to count how many vowels are there in a string.
5. Write a program to compare two strings.
6. Write a program to remove all duplicate characters, spaces from a string.
Functions/Sub functions
1. Write a function to do given operation on the two operands specified
Operations may be +,-,*,/,%
Hint: Prototype of function should be
float operate(float number1,float number2, char operation);
2. Write a function to print factorial of a number.
3. Write a function to check whether the entered number is Prime or Not
4. Write a function to check whether the entered String is Palindrome or not
5. Write a function to Inverse an alphabet for example say user Inputs A then
output must be in small case ‘a’ and vice versa.
6. Input values of base and index and calculate power.
7. Input a number and print Binary equivalent of that.
8. Find the Binary equivalent of a number using recursive calling.
9. Write a program to find sum of series
5|Page Learn Java, Python, C++, SQL, etc.
Hi-Tech Computers Best Known for
(Since 1999) C/C++/JAVA/SQL
X+X2/2!+X3/3!+X4/4!+……+XN/N!
10. Print all prime factors of a given number
11. Write a function to swap two numbers (use Call by reference approach);
12. Write a function to find sum of elements of an array. (use Pointers)
13. Write a function to find difference between two dates. (Create Structure Date
first then create function accordingly.)
STRUCTURES and FILE I/O
a) Write a program to accept employee name, employee ID and basic sal from
the user.
Calculate salary of an employee by considering HRA 12% of Basic salary, DA as
120% of Basic, 2% deduction of Basic salary for Canteen facility.
(Note define structure first then define function as AcceptEmployeeDetails(),
CalculateSalary() and DisplayEmployeeDetails() to display result.
b) Write the above program for accepting information of 10 employees.
c) Define a structure to represent time in hours(0-23), minutes(0-59) and
seconds(0-59) and then write a function that accepts as an argument a time
represented by this structure and add one minute and 30 seconds in it and
display new time.
d) Write a function named QuickSort() to sort records of employees
read/handled in Question at serial number b.
e) Write a function BSearch() to search the record of given employee name
f) Write a program to store the output generated through question at serial
number ‘b’ in a file named “employee.dat”
g) Write a program to read data from employee.dat and perform the tasks
mentioned in question at serial number ‘a’ of this unit.
6|Page Learn Java, Python, C++, SQL, etc.