1. Write a program to enter 10 floating numbers in an array and display it.
2. Write a program to display largest and smallest element of an array defined in Q.No. 1.
3. Write a program to initialize one dimensional array of size 8 and display the sum and average of array elements
4. Write a program to read two matrices of order 3 * 2, add them and display the resultant matrix in matrix form.
5. Write a program to multiply two 3*3 matrix. 6. Write a program to read a string and check for palindrome without using string related function (a string is palindrome if its half is mirror by itself eg: abcdcba).
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout<<"Enter the number of elements in Array: ";
cin>>n;
float a[n];
for (int i = 0; i<n; i++)
{
cout<<"Enter "<<i+1<<" element: ";
cin>>a[i];
}
for (int i = 0; i<n; i++)
{
cout<<i+1<<" Element: ";
cout<<a[i]<<endl;
}
}
Comments
Leave a comment