Menu Close

Program to find the biggest among three numbers using pointer

Codes:

https://gist.github.com/programmingfaster0226/3511f4cdba1a68c2c5e6dc4aa0eb696e

Outputs:

Enter three values: 0  2  26

The value of a: 0     b; 2      c:26

biggest number: 26

1 Comment

  1. sammy Mutahi

    using namespace std;

    void greatest(int *a,int *b,int *c)
    {
    if(*a>*b && *a > *c)
    {
    cout<<*a<<" is greater"< *a && *b > *c)
    {
    cout<<*b<<" is greater"<<endl;
    }else{
    cout<<*c<<" is greater"<<endl;
    }
    }
    int main()
    {
    int a =2;
    int b = 3;
    int c = 10;

    greatest(&a,&b,&c);

    return 0;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *