try this...

is_ascending(int a[],int i,int n){
        if(n==1)
                return(1);
        else if        (a[i]<a[i+1]){
                n--;
                return is_ascending(a,i+1,n);
        }
        else return(0);
}




"hassans_junkmail" <[EMAIL PROTECTED]>

11/09/2004 03:58 PM

Please respond to
[EMAIL PROTECTED]

To
[EMAIL PROTECTED]
cc
Subject
[c-prog] question







hi, am hassan, neeed soln pls 4 this exs by recursive fns method,
this is the soln by non recursive :
#include<iostream.h>
#include<conio.h>
int is_ascending(int [],int);
int main()
{
clrscr();
int a[3],n=3;
cout<<"Enter the 3 elements of the array";
for(int i=0;i<n;i++)
cin>>a[i];
cout<<is_ascending(a,n);
getch();
return 0;
}
int is_ascending(int a[3],int n)
{
for(int i=0;i<n;i++)
if(a[i]>a[i+1])
return 0;
else
return 1;
}


i need it by recursive pls..
bye






------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~->

To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/c-prog/

<*> To unsubscribe from this group, send an email to:
   [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/





ForwardSourceID:NT000072C2    
DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services Limited. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services limited on any subject matter.
Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services Limited takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services limited shall be understood as neither given nor endorsed by Tata Consultancy Services Limited or any affiliate of Tata Consultancy Services Limited. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail.
Thank you.


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=416419229


Yahoo! Groups Links

Reply via email to