Hi. I'm new here. I'm doing a lotto program. I have this difficilty that I want to display a title before the numbers are displayed. The numbers are all displayed by the computer using randimize. Above you can see the part of program i've done. Where should i put the writeln (' This is the lotto');?

Begin
Randimize
for i := 1 to 5 do
a := random(90)+1
For i := 1 to 5 do
writeLn (a);
end.

Recommended Answers

All 16 Replies

Begin
Randimize//this should be Randomize from i remember
writeln('This is lotto! Everybody win!!!more tickets, more chances');
for i := 1 to 5 do
a := random(90)+1
For i := 1 to 5 do
writeLn (a);
end.

Thank

thank you radu84. But i have another problem that is that if i want to display all the numbers which ar different. can you help?

different from what?

I want numbers which are different as for eg
if there is number 32 that number will not be seen again. Another thing which i can't make is doing a password program. please help me as soon as possible if you know it. thank you

so you want unique numbers, not "different" ones...
Most pseudo-random number generators will guarantee that, but it hardly ever hurts to make sure by just keeping track of the numbers you have already and just generating a new one if you already generated it before.

thank you very much. another thing i want is to add graphics to a pascal program. how can i do it? Please help

where can i download c++

i think that you don't know what you want!!! if you want c/c++ go to that section

Thank you very much. i appriciated what you had told me. thak you. i have a bit of a problem here. this is part of the project. here is the project:

Repeat
clrscr;
username := 'bala'
password := 'bulu'
writeln ('enter username');
readln;
writeln ('enter password');
readln;
until (pass='kitkat') and ('username ='cigar');
the problem is that when the program starts they will be shown togethor and all i want is that they will be displayed one after the other
when you had displayed the first one.Please help me.
thank you again

cigar, try to learn some alghoritmics before starting to code.

1) the program you post can't work. it is a total mess
2)try to think what you want to accomplish before starting to write the program. learn some pseudocod! put the scheme of the program on paper. this is the way how you learn programming.
3) here is the code:
program Project1;

uses CRT;
var username,password:string;
begin
Repeat
clrscr;
writeln ('enter username');
readln(username);
writeln ('enter password');
readln(password);
until (password='kitkat') and (username ='cigar');
Writeln('Learning Pascal')
end.

best regards

thank you very much
I appriciated

I don't know why but the code you had sent me doesn't work. can i send this program i've made by e-mail ?

why you are not posting your code here? in this way you and probably other beginners will learn.

so, post it here so we can see what you have done

best regards,

how can I write a program that enter 5 marks and display their minimum and maximum

no offense, but this is very easy to complete! this task can be performed by anybody, even he doesn't know programming

best regards,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.