Program to find largest and smallest among 5 numbers without using array

前端 未结 15 2225
遇见更好的自我
遇见更好的自我 2021-01-06 07:25

Yesterday I went for an interview where I have been asked to create a program to find largest and smallest among 5 numbers without using array.

I know how to create

15条回答
  •  春和景丽
    2021-01-06 08:06

    void main()
    {
    int a,b,c,d,e,max;
        max=a;
        if(b/max)
            max=b;
        if(c/max)
            max=c;
        if(d/max)
            max=d;
        if(e/max)
            max=e;
        cout<<"Maximum is"<

提交回复
热议问题