Assignment 5
Assignment 5
=====
Q1.Write programs for following questions.
2.Write a menu driven program for arithmetic operation of 2 integers using value
generating switch.
6.Write a menu driven program to find area and perimeter(or circumference) of shape
chosen by user.
For each shape ask user to choose area and perimeter or circumference.(nested
switch and use of functions expected).
9.Scan array of 8 integers from user.Find largest and smallest value from array.
Use of functions expected.
12.WAP to scan and print 1-D array of 6 integers using for each loop only.
13.WAP to copy source array of 6 integers into target array using for each loop
only.
1.Create a 2-D array of 3X5.Scan its values from user.Print addition of only even
elements in aray.
3.Create two 1-D arrays of n elements.Scan data for each aray from user.Store
indexwise addition of squares
of elements of both arrays in third array.Print third array.Example given below.
input =
first array = 2 4 7 3 2
Second array = 3 4 2 2 3
==================================
Result Array = 13 32 53 13 13
5.Create a 2-D array of 3X5.Scan and print this array using for each loop.
7.Scan a number from user in integer variable.Now store this number in an array in
such a way that
each element of array contains one digit of number.
Do this for 2 integers.Now perform addition of given 2 numbers using 2 arrays you
have used
to store digits.Print the addition.
8.Scan 10 integers from user.Store them in an array num in such a way that
everytime you add element
in array,array remains sorted in ascending order.
9.Scan a number from user.Find its binary hexadecimal and octal value.
Store these values in array and print those values.
14.Scan a 2-D array of mXn.Find minimum and maximum values from array.