Simple C++ Program Tutorial eleven

In this program user types how many digits he wants and which number,

the program writes those digits from biggest to the smallest…

/*

In this program user types how many digits he wants and which number, 

the program writes those digits from biggest to the smallest…

*/

#include

#include

using namespace std;

int main(int argc, char *argv[])

{

    int broj;

    int cifre;

    cout<<”How many digits you want….”<

    cin>>cifre;

    cout<<”Now type your nuber…….”<

    cin>>broj;

    int niz[cifre];

    for(int i=0;i

            niz[i]=broj%10;

            broj=broj/10;          

            }

    int brojac;

    while(brojac!=0){

                     brojac=0;

    for(int i=0;i

            if(niz[i]

                                int temp;

                                temp=niz[i];

                                niz[i]=niz[i+1];

                                niz[i+1]=temp;

                                brojac++;

                                }

            }}

    cout<

    for(int i=0;i

            cout<

            }

    cout<

    system(”PAUSE”);

    return EXIT_SUCCESS;

}

Here you can find more C++ Programs

3
Liked it
No Responses to “Simple C++ Program Tutorial eleven”
Post Comment
comments powered by Disqus