<

Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Turbo C++  Program That Executes Lottery Numbers Up To Six Randomly

Published on
5,451 Points
2,451 Views
Last Modified:

Programming  of  forecasting lottery numbers for self use  on Turbo C++ is done by use of random number generator code by a program algorithm logic. Random numbers usually generates numbers between definite interval. Therefore, when entering the code each time, new outcomes of numbers as requested can be guessed. The following code generates six numbers out of forty nine possible numbers starting from one.
#include
#include
#include
main ()
{
    int n,max,num,c;
                printf ("Lottery Numbers Forecasting Module ------>");
                printf (" How many numbers you request  enter here --------->");
                scanf ("%d",&n);
              printf ("  Lottery 49 number enter ............>);
              scanf("%d",&max);
              printf ("%d,tahmin sayilari 0 to %d are :-\n",n,max);
              randomize();
              for (c = 1 ; c <=n ; c++ )
              {
              num = random(max);
                    printf ("%d\n",num);
                 }
                    getch();
                return 0 ;
           }


Randomize command supplies a set of numbers. Thus,when the code is copy & pasted to the Turbo C++ compiler and run it, the result is six chance numbers. Repeating the process wil give new set of numbers too.

By refreshing the process you can get more chance numbers.

Step one of the algorithm asks the user to enter which number requested as maximum number that will random numbers will generate.

The first step;

printf "how many numbers you request to print screen?"

As secondly, this time the algorithm asks user to which maximum number array interval required.

printf " enter fourty nine number as a maximum interval."

For the lottery chance numbers, fourty nine as maximum value is used as an example, this max number is optional too.
Users can also define other maximum number values.

As a conclusion, by the twenty one code line ,turbo C++ forecasting numbers by the support of Randomize command is implemented. The changing border values is possible to get new numbers for different aims such as reward lottery choice form set of many people ID's.
 





 
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Administrative Comment

by:Taylor Pori
Nadir,

Here are a few suggestions of changes you can make to meet the minimum requirements for article acceptance:

1.      Consider adding an introductory paragraph to your article. The introduction gives the reader a short “preview” of the topics and sub-topics to be covered in the subsequent paragraphs.
2.      Consider adding a concluding paragraph to your article. The conclusion summarizes the main points that were covered within the body of the article.
3.      Review complex instructions or explanations covered in your article and consider breaking them down into smaller steps or adding more detail.  

Let me know if you have any questions,

Taylor
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Join & Write a Comment

This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Next Article:

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month