answersLogoWhite

0


Best Answer

'ln' -- it means 'new line' after writing

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between write and writeln in pascal?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Difference between write and writeln in javascript?

write() will just be a line of text and writeln() will be a line of text that puts the next writeln() on another line


How can you start the program 'read in the lengths of the sides of a triangle and determine whether the triangle is an isosceles triangle two sides are equal an equilateral triangle three sides are'?

This would depend on what programming language you wanted to write it in. For example, in Pascal, the code might look like this: Program Isosceles; Var A, B, C : Real; Begin WriteLn('Input side A.'); ReadLn(A); WriteLn('Input side B.'); ReadLn(B); WriteLn('Input side C.'); ReadLn(C); If A = B Then Begin If B = C Then Begin WriteLn('This triangle is equilateral.'); End Else Begin WriteLn('This triangle is isosceles.'); And so on.


What is the code for creating a menu on pascal?

Well if you want to create a menu, you may use CASE.This is the programprogram Menu;var menu:integer;beginwriteln('Menu');writeln('1. XXXXXXX');writeln('2. XXXXXXX'); {unlimited option you want}writeln; {just to make it pretty :)}write('Mode you want to choose');readln(menu);CASE menu OF1: {program if I choose 1 from the menu};2: {program if I choose 2 from the menu};end; {end of case}readln;end.


Write a program in pascal that calculates the area of a circle?

{Area s the area of cube} {Length is the length of one side of the cube} program AreaofCube; var Area,Length:real; begin write('Enter the length of cube: '); readln(Length); Area:=6*(Length*Length); writeln('The area of cube is ', Area, ' cm^2.'); end.


What is the difference between a readline statement and a writeline statement?

The readline statement method of programming will allow for the next statement in the sequence to be read. The writeline method of programming only allows for the current statement or sequence to be read after determining the end of the last line.

Related questions

Difference between write and writeln in javascript?

write() will just be a line of text and writeln() will be a line of text that puts the next writeln() on another line


Write a pascal program that compute an area of a triangle?

{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.


How can you start the program 'read in the lengths of the sides of a triangle and determine whether the triangle is an isosceles triangle two sides are equal an equilateral triangle three sides are'?

This would depend on what programming language you wanted to write it in. For example, in Pascal, the code might look like this: Program Isosceles; Var A, B, C : Real; Begin WriteLn('Input side A.'); ReadLn(A); WriteLn('Input side B.'); ReadLn(B); WriteLn('Input side C.'); ReadLn(C); If A = B Then Begin If B = C Then Begin WriteLn('This triangle is equilateral.'); End Else Begin WriteLn('This triangle is isosceles.'); And so on.


What is the code for creating a menu on pascal?

Well if you want to create a menu, you may use CASE.This is the programprogram Menu;var menu:integer;beginwriteln('Menu');writeln('1. XXXXXXX');writeln('2. XXXXXXX'); {unlimited option you want}writeln; {just to make it pretty :)}write('Mode you want to choose');readln(menu);CASE menu OF1: {program if I choose 1 from the menu};2: {program if I choose 2 from the menu};end; {end of case}readln;end.


How do you solve this pascal Edit my code in pascal i really need come help. here's my code. Sorry but its a bit messy. unit hospital interface uses crt implementation Var namestring typeofroomtptvcha?

i mean unit hospital; interface uses crt; implementation Var name:string; typeofroom,tp,tv:char; month, day, year, daysstayed,roomcharge,tpcharge,tvcharge,nory1,nory2,totalcharge:integer; const pc=125; sc=95; Wc=75; Tvc=3.50; Tpc=1.75; begin //prompting writeln('please enter the patients''s name':44); readln(name); writeln('please enter the number of days stayed in the hospital':63); readln(daysstayed); writeln('please write the month':31); readln(month); writeln('please write the day':29); readln(day); writeln('pelase enter the year':30); readln(year); writeln('please enter y or n for which typeofroom you used. P for private, S for semi private, and W for ward':57); readln(typeofroom); Case typeofroom of 'P':roomcharge:=(pc*daysstayed); 's':roomcharge:=(sc*daysstayed); 'w':roomcharge:=(wc*daysstayed); end; writeln('enter y or n for yes or no if they used the telephone':62); readln(nory1); Case tpcharge of 'Y':(tpcharge:=tpc*daysstayed); 'N':(tpcharge:=0); end; writeln('enter y or n for yes or no if they used the television':63); readln(nory2); Case tvcharge of 'Y':(tvcharge:=Tvc*daysstayed); 'N':(tvcharge:=0); end; //computing Totalcharge:=roomcharge+tvcharge+tpcharge; // end.


Example code in pascal that will convert numbers into words?

function conv2(x:integer):string;forward; function conv3(x:integer):string;forward; {***********Fonction_1*************} function conv1(x:integer):string; var temp:string; begin if (x>19) and (x<100) then conv2(x) else if (x>100) then conv3(x) else begin case x of 1:temp:='un '; 2:temp:='deux '; 3:temp:='trois '; 4:temp:='quatre '; 5:temp:='cinq '; 6:temp:='six '; 7:temp:='sept '; 8:temp:='huit '; 9:temp:='neuf '; 10:temp:='dix '; 11:temp:='onze '; 12:temp:='douze '; 13:temp:='treize '; 14:temp:='quatorze '; 15:temp:='quinze '; 16:temp:='seize '; 17:temp:='dix sept '; 18:temp:='dix huit '; 19:temp:='dix neuf '; end; conv1:=temp; end; end; {*************Fonction_2******************} function conv2(x:integer):string; var temp:string; z,y:integer; begin if (x<20) then conv1(x) else if (x>100)then conv3(x) else begin z:=x div 10; {= pour garder la partie gauche de x [4]5} y:=x mod 10; {= pour garder la partie droite de x 4[5]} if y=0 then begin case z of 2:temp:='vingt '; 3:temp:='trente '; 4:temp:='quarante '; 5:temp:='cinquante '; 6:temp:='soixante '; 7:temp:='soixante diz '; 8:temp:='quatre vingt '; 9:temp:='quatre vingt dix '; end; end else if y=1 then begin case z of 2:temp:='vingt et un '; 3:temp:='trente et un '; 4:temp:='quarante et un '; 5:temp:='cinquante et un '; 6:temp:='soixante et un '; 7:temp:='soixante et onze '; 8:temp:='quatre vingt et un '; 9:temp:='quatre vingt et onze '; end; end else begin case z of 2:temp:='vingt '+conv1(y); 3:temp:='trente '+conv1(y); 4:temp:='quarante '+conv1(y); 5:temp:='cinquante '+conv1(y); 6:temp:='soixante '+conv1(y); 7:temp:='soixante '+conv1(10+y); 8:temp:='quatre vingt '+conv1(y); 9:temp:='quatre vingt '+conv1(10+y); end; end; conv2:=temp; end; end; {****************fonction_3*******************} function conv3(x:integer):string; var temp:string; z,y:integer; begin if (x>19) and (x<100) then conv3:=conv2(x) else if (x<20)then conv3:=conv1(x) else begin z:=x div 100; {= pour garder la partie gauche de x [1]45} y:=x mod 100; {= pour garder la partie droite de x 1[45]} case z of 1:temp:='cent '; 2..9:temp:=conv1(z)+'cents '; end; case y of 1..19: temp:=temp+conv1(y); 20..99:temp:=temp+conv2(y); end; conv3:=temp; end; end; {**********Fin des fonctions de la conversion***********} Begin {----# Initialisation #-------} debut: ClrScr; i:=1; bool:=true; {-----# Selection de type du produit #------} while bool=true do begin clrscr; New(tab[i]); writeln;writeln; Writeln(' le type du produit '); writeln(' 1.Aliment/Détergent'); writeln(' 2.Electromenager'); writeln(' 3.Meuble'); writeln(' 4.Autre'); write(' FAITES VOTRE CHOIX : '); readln(c); case c of '1':tab[i]^.TVA:=(5/100); '2':tab[i]^.TVA:=(15/100); '3':tab[i]^.TVA:=(20/100); '4':tab[i]^.TVA:=(10/100) else goto debut; {-------- si c () 1..4 retour au debut } end; {------# Lire les attributs de chaque produit #-------} writeln; writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'); writeln(' ³Numero de Produit ³ ³'); writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'); writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'); writeln(' ³Designation ³ ³'); writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'); writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'); writeln(' ³PrixUnitaire ³ ³'); writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'); writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'); writeln(' ³Quantite ³ ³'); writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'); writeln; with tab[i]^ do begin gotoxy(38,13); writeln(i); num:=i; gotoxy(38,16); readln(design); gotoxy(38,19); readln(prixU); gotoxy(38,22); readln(Qt); end; writeln; writeln(' ³Y a t-il d''autre produit?o/n ³ ³'); gotoxy(49,23); c:=readkey; if c='o' then begin bool:=true; i:=i+1; end else bool:=false; end; {-------# Calculer les prixHT et TTC de chaque produit #-------} for j:=1 to i do begin with tab[j]^ do begin prixHT:=prixU*Qt; prixTTC:=prixHT+prixHT*TVA; end; end; {----# Calculer le total HT et TTC de la facture #----} totalHT:=0; totalTTC:=0; for j:=1 to i do begin with tab[j]^ do begin totalHT:=totalHT+prixHT; totalTTC:=totalTTC+prixTTC; end; end; {-------------------# Affichage de la facture #---------------------} writeln;writeln; textcolor(2); writeln(' ÚÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿'); writeln(' ³Num³Designation³Prix Unitaire³QUANTITE³TVA %³ PrixHT ³ PrixTTC ³'); writeln(' ÃÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ³ÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛ³ÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛÛ³ÛÛÛÛÛÛÛÛÛÛ³'); writeln(' ÀÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ'); writeln(' ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿'); writeln(' ³TOTAL HT ³ ³'); writeln(' ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´'); writeln(' ³TOTAL TTC ³ ³'); writeln(' ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ'); textbackground(blue); textcolor(14); for j:=1 to i do begin with tab[j]^ do begin gotoxy(12,j+3); writeln(num:2); gotoxy(16,j+3); writeln(design); gotoxy(29,j+3); writeln(PrixU:2:2); gotoxy(45,j+3); writeln(Qt:0:0); gotoxy(53,j+3); writeln(TVA*100:0:0); gotoxy(58,j+3); writeln(PrixHT:2:2); gotoxy(70,j+3); writeln(PrixTTC:2:2); end; end; gotoxy(69,21); writeln(totalHT:2:2,' DA'); gotoxy(69,23); writeln(totalTTC:2:2,' DA'); {-------#conversion#--------} milles:=''; cents:=''; a:=trunc(totalTTC); b:=frac(totalTTC); d:=trunc(b*100); x:=a div 1000; if x=0 then milles:='' else if x=1 then milles:='mille ' else milles:=conv3(x)+'milles '; y:=a mod 1000; if y=0 then cents:='' else cents:=conv3(y); resultat:=milles+cents; gotoxy(1,24); writeln('Arrèt la facture à la somme :'); write(resultat,'DA '); if d=0 then writeln('') else if d=1 then writeln('et un centime') else writeln('et ',conv3(d),'centimes'); readln; end.


Write a program in pascal that calculates the area of a circle?

{Area s the area of cube} {Length is the length of one side of the cube} program AreaofCube; var Area,Length:real; begin write('Enter the length of cube: '); readln(Length); Area:=6*(Length*Length); writeln('The area of cube is ', Area, ' cm^2.'); end.


What is the difference between wright And write?

Type your answer here... WHAT IS DIFFERENCE BETWEEN WRIGHT AND RIGHT


How does write statement differ from writeln statement?

I think you mean written statement. What you are asking about write statement you are confusing with written statement, the same with write in statement. A written statement is simply putting your words, or your version of events in writing.


What is the difference between a readline statement and a writeline statement?

The readline statement method of programming will allow for the next statement in the sequence to be read. The writeline method of programming only allows for the current statement or sequence to be read after determining the end of the last line.


Define write-off in medical billing?

Write off is the difference between total charge and the allowable amount by the insurace. Write off is the difference between total charge and the allowable amount by the insurace.


Hi i need some help with a programme i am writing in turbo delphi Im trying to make a hangman game and i either want the letter to appear or display the alphabet and the letter will disappear?

Uses SysUtils; Type TGuessStatusArray = Array[1..20] Of Char; TLettersGuessedArray = Array[1..26] Of Char; Var NewPhrase : String; PhraseHasBeenSet : Boolean; PhraseGuessed : Boolean; Choice : Integer; GuessStatusArray : TGuessStatusArray; LettersGuessedArray : TLettersGuessedArray; NextGuessedLetter : Char; Index : Integer; Procedure DisplayMenu; Begin Writeln('__________________________________'); Writeln; Writeln('1. SETTER - Makes new word/phrase'); Writeln; Writeln('2. USER - Next letter guess'); Writeln; Writeln('5. End'); Writeln; End; Function GetNewPhrase : String; Var PhraseOK : Boolean; ThisNewPhrase : String; Begin Repeat Write('Key in new phrase ...(letters and any Spaces) '); Readln(ThisNewPhrase); If Length(ThisNewPhrase) < 10 Then Begin PhraseOK := False; Writeln('Not enough letters ... '); { possible further validation check(s) } End Else Begin PhraseOK := True; GetNewPhrase := ThisNewPhrase; End; Until PhraseOK = True; End; Procedure SetUpGuessStatusArray(NewPhrase : String; Var GuessStatusArray : TGuessStatusArray); Var Position : Integer; Begin For Position := 1 To Length(NewPhrase) Do Begin If NewPhrase[Position] = ' ' Then GuessStatusArray[Position] := ' ' Else GuessStatusArray[Position] := '*'; End; End; Procedure DisplayCurrentStatus(PhraseLength : Byte; GuessStatusArray : TGuessStatusArray); Var Position : Integer; Begin For Position := 1 To PhraseLength Do Write(GuessStatusArray[Position]); Writeln; End; Function GetNextLetterGuess : Char; Var Position : Integer; GuessedLetter : Char; Begin Writeln; Write('Next guess ? '); Readln(GuessedLetter); GetNextLetterGuess := GuessedLetter; End; Function AllLettersGuessedCorrectly(GuessStatusArray: TGuessStatusArray; NewPhrase : String) : Boolean; Var Position : Integer; MissingLetter : Boolean; Begin MissingLetter := False; Position := 1; Repeat If GuessStatusArray[Position] <> NewPhrase[Position] Then MissingLetter := True Else Position := Position+1; Until (MissingLetter = True) or (Position = Length(NewPhrase)+1); If MissingLetter = False Then AllLettersGuessedCorrectly := True Else AllLettersGuessedCorrectly := False; End; { Main program block starts here } Begin PhraseHasBeenSet := False; Repeat DisplayMenu; Write('Choice? '); Readln(Choice); If Choice = 1 Then Begin NewPhrase := GetNewPhrase; SetUpGuessStatusArray(NewPhrase, GuessStatusArray); PhraseHasBeenSet := True; End; If Choice = 2 Then Begin If PhraseHasBeenSet = True Then Begin DisplayCurrentStatus(Length(NewPhrase), GuessStatusArray); NextGuessedLetter := GetNextLetterGuess; For Index := 1 To Length(NewPhrase) Do If NextGuessedLetter = NewPhrase[Index] Then GuessStatusArray[Index] := NextGuessedLetter; DisplayCurrentStatus(Length(NewPhrase), GuessStatusArray); PhraseGuessed := AllLettersGuessedCorrectly(GuessStatusArray,NewPhrase); If PhraseGuessed = True Then Writeln('You have guessed correctly'); End Else Writeln('The setter has not specified the word/phrase ..'); End; If (Choice = 5) And (PhraseGuessed = False) Then Begin Writeln('You have not completed this word/phrase...Press return to exit'); Readln; End; Until Choice = 5; End.