14. Write a program to find transpose of a given matrix of mxn size using unary operator overloading

/* TRANSPOSE OF A GIVEN MATRIX OF MXN SIZE USING UNARY OPERATOR OVERLOADING */ 


#include<iostream>
using namespace std;
class matrix
{
        int x[5][5],m,n;
public:
        matrix()
        {

        }
        matrix(int a,int b)
        {
               m=a;n=b;
        }
        void get();
        void put();
        matrix operator !();
};
void matrix::get()
{
        int i,j;
        cout<<"\n Enter a matrix of order"<<m<<"x"<<n<<"\n";
               for(i=0;i<m;i++)
                   for(j=0;j<n;j++) 
                        cin>>x[i][j];
}
void matrix::put()
{
         int i,j;
        cout<<"\n The matrix after TRANSPOSE is :\n";
        for(i=0;i<n;i++)
        {
               for(j=0;j<m;j++)
                    cout<<x[i][j]<<"\t";
               cout<<endl;
     }
}

matrix matrix::operator !()
{
        matrix c(n,m);
        int i,j;
        for(i=0;i<m;i++)
               for(j=0;j<n;j++)
                    c.x[i][j]=x[j][i];
         return c;
}

int main()
{
        int m,n;
        cout<<"\n Enter the order of  matrix \t";
        cin>>m>>n;
        matrix a(m,n),c;
        a.get();
        c=!a;
        c.put();
        return 0;
}
Posted by Unknown On 05:17 26 comments

26 comments:

  1. The main function contains a mistake after opening the flower brackets 4 th line is mistake i.e.,matrix a(m,n),c(m,n);

    ReplyDelete
  2. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

    DevOps Training in Bangalore

    ReplyDelete
  3. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    Click here:
    Angularjs training in chennai

    Click here:
    angularjs training in bangalore

    Click here:
    angularjs training in online

    Click here:
    angularjs training in Annanagar

    ReplyDelete
  4. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    Click here:
    Microsoft azure training in chennai
    Click here:
    Microsoft azure training in annanagar
    Click here:
    Microsoft azure training in velarchery

    ReplyDelete
  5. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    Data Science training in marathahalli
    Data Science training in btm
    Data Science training in rajaji nagar
    Data Science training in chennai
    Data Science training in kalyan nagar
    Data Science training in electronic city
    Data Science training in USA
    Data science training in pune



    ReplyDelete
  6. That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.
    python training in tambaram
    python training in annanagar
    python training in OMR
    python training in chennai

    ReplyDelete
  7. if outputs are provided then it very good

    ReplyDelete
  8. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    angularjs-Training in chennai

    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    ReplyDelete
  9. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.

    AWS Interview Questions And Answers

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    AWS Training in Pune | Best Amazon Web Services Training in Pune

    Amazon Web Services Training in Pune | Best AWS Training in Pune

    AWS Online Training | Online AWS Certification Course - Gangboard

    ReplyDelete
  10. I would really like to read some personal experiences like the way, you've explained through the above article. I'm glad for your achievements and would probably like to see much more in the near future. Thanks for share.
    python interview questions and answers | python tutorialspython training institute in electronic city

    ReplyDelete
  11. This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

    ReplyDelete
  12. Nice post. I learned some new information. Thanks for sharing.

    karnatakapucresult
    Guest posting sites

    ReplyDelete
  13. I'm hoping you keep writing like this. I love how careful and in depth you go on this topic aws certification. Keep up the great work

    ReplyDelete
  14. Thanks for sharing such an awesome Information with us

    I Got Job in my dream company with decent 12 Lacks Per Annum salary, I have learned this world most demanding course out there in the current IT Market from the Big Data Training In Bangalore Providers who helped me a lot to achieve my dreams comes true. Really worth trying.

    ReplyDelete
  15. I am very proud to read such an informative blog. i Will follow your updates in future so, please add more and more ideas.web design company in velachery

    ReplyDelete
  16. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well. Web Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery

    ReplyDelete
  17. I am really happy to say it’s an interesting post to read. I learn new information from your article, you are doing a great job, good luck.
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  18. Some may stag in Interviews!!! OOPS!! More than 50% of students do this in their career. Instead, do Hadoop Training in Chennai at Infycle. Those students can easily clear this Interview session because more than 5 times at INFYCLE practicing mock-interview sessions, Hence students are Getting out of their interview fear.

    ReplyDelete

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Blog Archive

Contact Us


Name

E-mail *

Message *