Jugwancommunication

Follow Us:

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

C++

byYogesh Rajput -June 14, 2021
0
#include <iostream>
using namespace std;
class metrix
{
public:
int row, col, i, j,sum,arr[10][10];
   void get(){
       cout<<"Enter Row Number";
        cin >> row;
        cout<<"Enter Col Number";
        cin >> col;
        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;
        }
   };
    virtual void sumdiplay() = 0;
};
class derived : public metrix
{
public:

    void get(){};
    virtual void sumdiplay(){
        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;
        }
    };
};
int main()
{
    metrix *ptr;
    derived derivedobj;
    ptr = &derivedobj;
    ptr->get();
    ptr->sumdiplay();

    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