Skip to main content

C++ Program to implement Function Overloading

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include
#include

const int MAX = 3;
int   Sum (int, int);
void  Sum (char *, char *);
void  Sum (int [][MAX], int [][MAX]);
void main(){
    int a, b;
    char x[10], y[10];
    int mat1[MAX][MAX], mat2[MAX][MAX], tot[MAX][MAX];
    clrscr();
    cout<<"\n Integers:- "<
    cout<<"\n Enter value of a: ";
    cin>>a;
    cout<<"\n Enter value of b: ";
    cin>>b;
    cout<<"\n Sum of Integers "<" & "<" is: "<
    cout<<"\n Strings:- "<
    cout<<"\n Enter value of x: ";
    cin>>x;
    cout<<"\n Enter value of y: ";
    cin>>y;
    cout<<"\n Sum of Strings "<" & "<" is: ";
    Sum(x, y);
    cout<<"\n Integer Matrices:- "<
    cout<<"\n Enter values in Matrix mat1: ";
    for(int i=0; i
        for(int j=0; j
            cin>>mat1[i][j];
    cout<<"\n Enter value in Matrix mat2: ";
    for(i=0; i
        for(j=0; j
            cin>>mat2[i][j];
    cout<<"\n Sum of Matrices is:-"<
    Sum(mat1, mat2);
    getch();
    }
int Sum(int a, int b){
    return (a+b);
    }
void Sum(char *a, char *b){
    int i = 0, j = 0;
    char c[20];
    while(*(a+i) != '\0'){
        *(c+i) = *(a+i);
        i++;
        }
    while(*(b+j) != '\0'){
        *(c+i) = *(b+j);
        i++;
        j++;
        }
    *(c+i) = '\0';
    cout<
    }
void Sum(int m1[MAX][MAX], int m2[MAX][MAX]){
    int tot[MAX][MAX];
    for(int i=0; i
        for(int j=0; j
            tot[i][j] = m1[i][j] + m2[i][j];
            cout<<" "<
            }
        cout<
        }
}

Comments

Popular posts from this blog

USE any TRIAL SOFTWARE FOREVER WITHOUT SERIAL NUMBER

USE any TRIAL SOFTWARE FOREVER WITHOUT SERIAL NUMBER(most wanted trick) Run a trial software forever now with time stopper you can run a trial software forever no need to fetch for serial numbers,activation codes,patch just DOWNLOAD TIME STOPPER now open it install it click browse select the .exe of the software or file which you want to run forever now simply click create desktop icon and now delete all its existing shortcuts now have fun enjoying software for life time

C++ Program to Find HCF and LCM among 4 numbers (Easiest Logic)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include <iostream> #include <math.h> using namespace std; int main () { int a,b,c,d,i,j,minimum; cout << "Enter the all four number " ; cin >> a >> b >> c >> d; if (a < b && a < c && a < d) minimum = a; else if (b < c && b < d) minimum = b; else if (c < d) minimum = c; else minimum = d; for (j = minimum;; -- j) { if (a % j == 0 && b % j == 0 && c % j == 0 && d % j == 0 ) { break ; } } for (i = 1 ;;i ++ ) { if (i % a == 0 && i % b == 0 && i % c == 0 && i % d == 0 ) break ; } cout << "Lowest Common factor=>" << i << endl; ...

12 Tips to Maintain a Virus Free Computer

1. Email is one of the common ways by which your computer can catch a virus . So it is always recommended to stay away from SPAM. Open only those emails that has it’s origin from a trusted source such as those which comes from your contact list. If you are using your own private email host (other than gmail, yahoo, hotmail etc.) " then it is highly recommended that you use a good anti-spam software. And finally NEVER click on any links in the emails that comes from untrusted sources. 2. USB thumb/pen drives is another common way by which viruses spread rapidly." So it is always a good habit to perform a virus scan before copying any data onto your computer. NEVER double-click the pen drive to open it. Instead right-click on it and select the option “open”. This is a safe way to open a pen drive. 3. Be careful about using MS Outlook. Outlook is more susceptible to worms than other e-mail programs, unless you have efficient Anti-Virus programs running. Use Pegasus ...

How to Put Google Adsense Below Post Title in Blogger?

Adsense is used by majority of expert bloggers for their website monetization because it is a cookie based contextual advertising system that shows targeted ads relevant to the content and reader. As bloggers are paid on per click basis, they try various ad placements on the blog to  increase the revenue  and get maximum clicks on the ad units. Well, on some blogs, you might have seen Adsense ad units placed below the post title. Do you know why? It is because the area just below the post title gets the most exposure and is the best place to put AdSense ad units to increase  Click Through Rate (CTR). Even though ads below post title work like a charm but this doesn’t mean that it will work for you as well. If you want to find out the best AdSense ads placement for your blog, try experimenting by placing ads at various locations such as header, sidebar, footer, etc. You can try other  blog monetization methods  as well to effectively monetize y...

FIXED: Feedjit gadgets no longer work on my blog!!! help

well if your feedjit tracker is not working than you can easily fix this... goto blogger.com Go to  Dashboard -> Settings And set  HTTPS Redirect  to  No The gadgets will work now for  http ://yourblog.blogspot.com They won't for  https ://yourblog.blogspot.com because their connection isn't secure. this is not a permanent fix ... the gadget developers will have to make their gadgets https ready before Blogger will (if at all) become https only.

How to Hack an Ethernet ADSL Router

Every router comes with a  username  and  password  using which it is possible to gain access to the router settings and configure the device. The vulnerability actually lies in the  Default username  and  password  that comes with the factory settings. Usually the routers come preconfigured from the Internet Service provider and hence the users do not bother to change the password later. This makes it possible for the attackers to gain unauthorized access to the router and modify its settings using a common set of default usernames and passwords. Here is how you can do it. Before you proceed, you need the following tool in the process: Angry IP Scanner Hacking the ADSL Router: Here is a detailed information on how to exploit the vulnerability of an ADSL router: Go to  whatismyipaddress.com . Once the page is loaded, you will find your IP address. Note it down. Open Angry IP Sca...

WHAT IS CSS? A BEGINNER’S GUIDE FOR BLOGGERS

WHAT IS CSS? CSS stands for  Cascading Style Sheet . Where  HTML  is what defines the  structure  and content of a web page, a  Cascading Style Sheet  is a web document that allows you to change the  appearance  of the HTML. CSS allows you to change the size, style, font, and color of text; margins and padding; background colors and border styles. It can also be used to position elements on a page (but we’ll leave that for another day). ONE BIG ADVANTAGE OF CSS IS CONSISTENCY The best thing about CSS is that allows you to make global style changes  that affect every instance of a certain element throughout your blog or website so that you don’t have to make these changes at the individual page level. This saves you a ton of time when it comes to redesigning your blog. Here’s an example of what I mean: as we learned last week, the page title on a blog page is defined by an HTML element called an H1 (heading 1). By default,...

remove the usb virus instruction

REmOVE VIRUS THAT CAUSES FILES IN REMOVBLE RIVE/PEN DRIVE/MEMORY CARD TO become shortcut. Hello friend You can easily remove VIRUS THAT CAUSES FILES IN REMOVBLE RIVE/PEN DRIVE/MEMORY CARD TO become shortcut. For this just download usbfix software here . Step 1:- UNRAR AND DOUBLE CLICK IT WILL  INSTALL ~~~~~~~~~~~~Plug in all your drive that are corrupted with virus ~~~~~~~~~~~~~~~~~ 2:- now first click on” research “button.~~~~~~~~~~~~~~~by RAAJ DUBEY~~~~~~~~~~~~~~~ ~~~~~~~~~~Be patient this step may take many time it will hang on 73 % for much time. Do not cancel here~~~~~~~~~~~~~~~~~~~~~`` 3:- now click on “deletion” button ~~~~~~~~~~usbfix window will close ~ now again double click on usbfix ico located at desktop~~~~~~~~~~~JINJAX TRICK ~~~~~~~~~~~~~~~~~~~` ~~~~~~~again it will scan and delete virus~~~~~~~~~~~~~~` 4:- now click on “lising” button t list all your files back in pd means all shortcut will be deleted and Original folder ,file will b...

what is LOREM ipsum and why do designers use it

What is Lorem Ipsum? Lorem Ipsum  is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now...