Jugwancommunication

Follow Us:

  • Home
  • News
  • FreeSoftware
  • OperatingSystem
  • ComptureLanguage
  • _Python
  • Faridabad Job's
HomeShortCode

C++

byYogesh Rajput -June 13, 2021
0


#include <iostream>
using namespace std;

class matrix
{
private:
    int a, b;
    int r, c;

public:
    void set()
    {
        int row, col, i, j;
        r = row;
        c = col;
        a = i;
        b = j;
        cout << "Enter Row Number" << endl;
        cin >> row;
        cout << "Enter Col Number" << endl;
        cin >> col;
        int arr[row][col];
        cout << "Enter Col Numbers and Row Numbers:-" << endl;
        for (i = 0; i < row; i++)
        {
            for (j = 0; j < col; j++)
            {
                cin >> arr[i][j];
            }
        }
        cout << "Display" << endl;
        for (i = 0; i < row; i++)
        {
            for (j = 0; j < col; j++)
            {
                cout << arr[i][j] << " ";
            }
            cout << endl;
        }
        cout << "Sum Display" << endl;
        for (i = 0; i < row; i++)
        {
            for (j = 0; j < col; j++)
            {
                arr[i][j] = arr[i][j] + arr[i][j];
                cout << arr[i][j] << " ";
            }
            cout << endl;
        }
    }
    virtual void get()
    {
        cout << "Class";
    }
};
class derived : public matrix
{
public:
    void set();
    void get()
    {
        matrix::set();
    }
};
;
int main(int argc, char const *argv[])
{
    matrix *ptr;
    derived d;
    ptr = &d;
    ptr->get();
    return 0;
}
Tags: ShortCode
  • Share on Facebook
  • Share on Twitter
You might like

If you have any doubts. Please Let me Know

Post a Comment

If you have any doubts. Please Let me Know

Post a Comment (0)

Previous Post Next Post

Follow Us

Advertisement

Main Tags

  • 16 GB RAM
  • 512GB SSD
  • 8 GB RAM
  • BestComputerCourses
  • Dell MS116 1000DPI USB Wired Optical Mouse
  • Excel
  • faridabadjob
  • Free_Software
  • HP 15 (2021) Thin & Light 11th Gen Core i5 Laptop
  • HP Pavilion (2021) Thin & Light 11th Gen Core i5 Laptop
  • Iris Xe Graphics
  • Java
  • JavaScript
  • MSOffice
  • Python
  • ShortCode
  • windows
  • Wired Keyboard and Mouse Combo with 104 Keys and a USB Mouse with

Featured post

Yogesh RajputSeptember 18, 2021

Advertisement

Tags

  • 16 GB RAM
  • 512GB SSD
  • 8 GB RAM
  • BestComputerCourses
  • Dell MS116 1000DPI USB Wired Optical Mouse
  • Excel
  • faridabadjob
  • Free_Software
  • HP 15 (2021) Thin & Light 11th Gen Core i5 Laptop
  • HP Pavilion (2021) Thin & Light 11th Gen Core i5 Laptop
  • Iris Xe Graphics
  • Java
  • JavaScript
  • MSOffice
  • Python
  • ShortCode
  • windows
  • Wired Keyboard and Mouse Combo with 104 Keys and a USB Mouse with

Pages

  • Terms and Conditions
  • Contact Us
  • JavaScriptTutorial
  • Today News

Advertisement

Contact Form