How to work with Record data type bye Example
To work with Record data type bye Example
Example:
program Welcome;
uses
WinCrt;
type
student=record
StudentNo:longint;
StudentName:string;
Department:string;
end;
var
mystudent:student;
begin
Writeln(' Please Enter your student information.');
Write(' Student No: ');
Readln(mystudent.StudentNo);
Write(' Student Name: ');
Readln(mystudent.StudentName);
Write(' Department: ');
Readln(mystudent.Department);
Writeln(' ');
Writeln('************************** Student Information *******************************');
Writeln('Student No: ',mystudent.StudentNo);
Writeln('Studnet Name: ',mystudent.StudentName);
Writeln(' Department: ',mystudent.Department);
Writeln('*******************************************************************************');
end.
Output:
No comments:
Post a Comment