http://ideone.com/xRnDo

# include<stdio.h># include<string.h>void findbig(char *a){
        int i,j;
        int flag=0;
        for(i=strlen(a)-1;i>0;i--)
        if(a[i-1]<a[i])
        {
                char temp=a[i];
                a[i]=a[i-1];
                a[i-1]=temp;
                flag=1;
                break;

        }
        if(flag==1)
        printf 
<http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("%s",a);
        else
        printf 
<http://www.opengroup.org/onlinepubs/009695399/functions/printf.html>("NO
number OF SAME DIGITS EXIT\n");
        }int main(){
        char a[]="7585";
        findbig(a);return 0;}

correct me if i am worng............

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to