sorry, I'm a bit ashamed of the code so far. am a bit lost on it.
Code:
var count,i,totnum,number,numcheck: integer;
pos,zero,neg:boolean;
begin {main program}
begin
write('Please type in how many numbers will be input ');
readln(totnum);
writeln('what numbers will be checked?');
read(numcheck);
pos:=numcheck>0; //boolean variables
neg:=numcheck<0;
zero:=numcheck=0;
// for count:= 0 to totnum do
if pos then write('This is a positive number');
if neg then write('This is a negative number');
if zero then write('This number is Zero');
cont;
end;
end.
{ program countspace(input,output);
var i,lenght,count:integer;
sentence:string;
begin
write('sentence: ');
readln(sentence);
for i:=0 to lenght (sentence) do //Do error??!?!?!?!
if (sentence[i] = ' ') or (sentence[i] ='.') then
count:=count+1;
writeln('spaces: ',count);
readln; end. }
The prog at the bottom is a simple one to read number of spaces but even that wouldn't compile. Simply don't knwo what I'#m doing wrong
Bookmarks