10
10
MULTIDIMENSIONAL ARRAY
AIM:
ALGORITHM:
STEP 2: Declare three multi-dimensional array arr1,arr2,arr3 and read the respective rows and column
STEP3: Read the values matrices arr1 and arr2 using for loop.
STEP4: Print the array elements of first matrix and second matrix in matrix format.
STEP5: Add arr1 and arr2 and store the result in arr3. This is done by dual for loops with looping variables i, j.
(arr3[i,j]=arr1[i,j]+arr2[i,j])
matrix format.
Aim:
Algorithm:
2. Declare s1 , s2 as string
4. Using clone() function on string s1 to clone the string object , and copy it to s.
5.Print string s1 and s2 are equal if the string.compare() function returns 0. Else print, string s1 and
s2 are not equal.
6.Concatenate two strings s1 and s2 using string function concat() and print.
7.Print every character of string s1 to lower case using string function ToLower().
8. Print every character of string s2 to upper case using string method ToUpper().
AND OBJECTS
Aim:
Algorithm:
2.Define a class , Employee with member function display() to print the employee id , name and
salary.
AIM:
ALGORITHM:
Step5:Define the display method of the interface in testClass, Get input for a,b and print the result.
AIM:
ALGORITHM:
Step2:Define class complex, inside the class initialize x and y variable using constructor.
Step4:Define complex operator overloaded method. Create object temp for class, complex. Add x and y and store it
onto temp.
Step5: Inside the main function, create three objects c1,c2,c3 for class complex.
Step 6: Arithmetic operation on objects (c3 = c1 + c2) invokes the operator overloaded method.