I created a simple number-guessing game.  Do I need to divide this program into functions?  Please offer suggestions.#include<iostream>#include<string>#include<ctime>void drawLine(int n, char symbol);void rules();int main(){    int amount;    int bettingAmount;    int guess;    int dice;    std::string playerName;    drawLine(60,'_');    std::cout << \n\n\n\t\tCASINO GAME\n\n\n\n;    drawLine(60,'_');    std::cout << \n\nEnter Your Name : ;    std::getline(std::cin, playerName);    std::cout << \n\nEnter Deposit amount to play game : ;    std::cin >> amount;    char choice;    do    {        system(cls);        rules();        std::cout << \n\nYour current balance is $  << amount << \n;        do        {            std::cout <<playerName<<, enter money to bet ;            std::cin >> bettingAmount;            if(bettingAmount > amount)                std::cout << Your betting amount is more than your current balance\n\nRe-enter data\n ;        }while(bettingAmount > amount);        do        {            std::cout << Guess your number to bet between 1 to 10 :;            std::cin >> guess;            if(guess <= 0 || guess > 10)                std::cout << Please check the number!! should be between 1 to 10\n\nRe-enter data\n ;        }while(guess <= 0 || guess > 10);        srand(time(0));        dice = rand()%10 + 1;        if(dice == guess)        {            std::cout << \n\nGood Luck!! You won Rs. << bettingAmount * 10;            amount = amount + bettingAmount * 10;        }        else        {            std::cout << Bad Luck this time !! You lost $ << bettingAmount <<\n;            amount = amount - bettingAmount;        }        std::cout << \nThe winning number was :  << dice <<\n;        std::cout << \n<<playerName<<, You have $  << amount << \n;        if(amount == 0)        {            std :: cout << You have no money to play ;            break;        }        std::cout << \n\n-->Do you want to play again (y/n)? ;                std::cin >> choice;    }while(choice =='Y'|| choice=='y');    std::cout << \n\n\n;    drawLine(70,'=');    std::cout << \n\nThanks for playing game. Your balance amount is $  << amount << \n\n;    drawLine(70,'=');    return 0;}void drawLine(int n, char symbol){    for(int i=0; i<n; i++)        std::cout << symbol;    std::cout << \n ;}void rules(){    system(cls);    std::cout << \n\n;    drawLine(80,'-');    std::cout << \t\tRULES OF THE GAME\n;    drawLine(80,'-');    std::cout << \t1. Choose any number between 1 to 10\n\t2. If you win you will get 10 times of money you bet\n\t3. If you bet on wrong number you will lose your betting amount\n\n;    drawLine(80,'-');}// END OF PROGRAM
Number-guessing game in C++
c++;game;random;dice;number guessing game