1. Phép toán

1.1. Số học:

Dành cho số nguyên


Dành cho số thực

+, -, *, Div, Mod   +, -, *, /
– Phép chia lấy phần nguyên: DIV

– Phép chia lấy số dư: MOD

– Ví dụ: 10 div 3 = 3;        10 mod 3 = 1;

5 div 10 = 0;        3 mod 7 = 3


1.2. Quan hệ: <; >; <=; >=; =; < >

1.3. Logic: And; Or; Not

Chú ý:

– Kết quả của các phép toán quan hệ trả về giá trị lôgic (True hoặc False)

– Ứng dụng của các phép toán lôgic để tạo ra các biểu thức phức tạp.

2. Biểu thức số học

Chú ý: Trong một số trường hợp để tránh phải tính lại biểu thức số học nhiều lần ta nên sử dụng biến trung gian.

  • TRUNC(x)”Trả về số nguyên gần với x nhất nhưng bé hơn x.
  • INT(x)”Trả về phần nguyên của x
  • FRAC(x)”Trả về phần thập phân của x
  • ROUND(x)”Làm tròn số nguyên x
  • PRED(n)”Trả về giá trị đứng trước n
  • SUCC(n)”Trả về giá trị đứng sau n
  • ODD(n)”Cho giá trị TRUE nếu n là số lẻ.
  • INC(n)”Tăng n thêm 1 đơn vị (n:=n+1).
  • DEC(n)”Giảm n đi 1 đơn vị (n:=n-1).

<Biểu thức1><phép toán quan hệ><Biểu thức2>
Biểu thức quan hệ

            (?) Biểu thức1, Biểu thức 2 ở đây là gì?

Vd: a>0; a+b>c;

  • Biểu thức lôgic

Các biến logic, hằng logic và các biểu thức quan hệ liên kết với nhau bằng phép toán logic.

Vd1: “x không âm” → x>=0 hoặc Not(x<0)

Vd2:  Dùng các phép toán lôgic để mô tả biểu thức lôgic sau: “i chẵn và i chia hết cho 5 hoặc i lẻ và i chia hết cho 3”

((i mod 2 = 0) and (i mod 5=0)) Or ((i mod 2 <>0) and (i mod 3=0))

  • Câu lệnh gán

Cp: <tên biến>:=<biểu thức>;

Var delta,a,b:Integer;

x1,x2: Real;ok:Boolean;

Hãy chỉ ra những lệnh đúng, sai và lý do sai?

A. a:=sqr(b);

B. b:=sqrt(a);

C. ok:=a/b;

D. delta:=sqrt(b*b-4*a*c);

E. ok:=a>b;

F. x1:=x2 mod 2;

(?) Cho đoạn ct sau: a:=5; b:=7;

tg:=a; a:=b; b:=tg;

Sau khi thực hiện đoạn ct trên giá trị của ab lúc này bằng bao nhiêu?

3. Soạn thảo, dịch, thực hiện và hiệu chỉnh chương trình

3.1. Đối với Turbo Pascal

Để soạn thảo, dịch, thực hiện và hiệu chỉnh chương trình Pascal cần có tối thiểu các tệp:


Một số lệnh và phím tắt thường dùng khi viết chương trình trong Pascal:

–   F2: Lưu chương trình đang soạn thảo vào đĩa.
–   F3: Mở file đã tồn tại trên đĩa để soạn thảo.
–   F4: Chạy chương trình đến vị trí con trỏ đứng.
–   Alt-F3: Đóng file đang soạn thảo.
–   Alt-F5: Xem kết quả chạy chương trình.
–   F7/F8: Chạy từng câu lệnh một trong chương trình.
–   Alt-<Số thứ tự của file đang mở>: Dịch chuyển qua lại giữa các file đang mở.
–   Ctrl-F7: Mở cửa sổ Watch theo dõi giá trị các biến.
–   Alt-F9: Dịch chương trình, sửa lỗi cho đến khi hết lỗi
–   Ctrl-F9: Chạy chương trình.
–   F10: Vào hệ thống Menu của Pascal.
–   Alt-X: Thoát khỏi Turbo Pascal.

Các thao tác trên khối văn bản

  • Chọn khối văn bản: Shift + <Các phím mũi tên>
  • Ctrl-KY: Xoá khối văn bản đang chọn
  • Ctrl-Insert: Sao chép khối văn bản đang chọn Clipboard (Ctrl+Ins)
  • Shift-Delete: Cắt khối văn bản đang chọn vào Clipboard.
  • Shift-Insert: Dán khối văn từ Clipboard vào vị trí con trỏ.

3.1. Đối với Free Pascal (Cài đặt theo hướng dẫn)

>> Còn nữa…


  1. Hello, Neat post. There’s an issue with your site in web explorer, might check
    this? IE nonetheless is the market chief and a big component of folks will pass
    over your magnificent writing because of this problem.

  2. I do not even know how I ended up here, but I thought this post was good.
    I don’t know who you are but certainly you are going to a famous blogger if you
    aren’t already 😉 Cheers!

  3. I used to be recommended this website by means of my cousin. I am now not positive whether
    or not this submit is written by way of him as nobody else
    recognise such distinct about my problem. You are wonderful!

  4. I’m impressed, I have to admit. Seldom do I encounter a blog that’s
    both equally educative and amusing, and without
    a doubt, you’ve hit the nail on the head. The issue is
    something too few folks are speaking intelligently about.

    Now i’m very happy that I stumbled across this during my
    hunt for something concerning this.

  5. Great blog right here! Also your website so much up very fast!
    What web host are you the usage of? Can I am getting your affiliate link for your host?
    I desire my site loaded up as fast as yours lol

  6. An impressive share! I’ve just forwarded this onto a
    coworker who had been doing a little research on this.
    And he in fact bought me lunch due to the fact that
    I stumbled upon it for him… lol. So allow me to reword this….

    Thank YOU for the meal!! But yeah, thanx for spending the time
    to talk about this subject here on your blog.

  7. I think this is one of the most important information for me.

    And i’m glad reading your article. But wanna remark on few
    general things, The site style is ideal, the articles is really
    great : D. Good job, cheers

  8. Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something.

    I think that you can do with some pics to drive the message home a bit, but instead of
    that, this is magnificent blog. A great read. I’ll certainly
    be back.

  9. Hi there! I understand this is somewhat off-topic however I had to
    ask. Does running a well-established blog such as yours require a massive amount work?
    I’m completely new to writing a blog but I do write in my journal everyday.
    I’d like to start a blog so I can share my experience and thoughts online.
    Please let me know if you have any suggestions or tips for new aspiring bloggers.

  10. A fascinating discussion is definitely worth comment.
    I believe that you should publish more on this issue, it might not be
    a taboo subject but generally people don’t speak
    about these issues. To the next! Best wishes!!

  11. I was recommended this blog by my cousin. I am not sure whether this post is written by him as nobody else know such detailed
    about my problem. You’re amazing! Thanks!

  12. Hey there would you mind letting me know which hosting company
    you’re utilizing? I’ve loaded your blog in 3 different web browsers and I must say this
    blog loads a lot faster then most. Can you recommend a good internet hosting provider at
    a reasonable price? Thanks a lot, I appreciate it!

  13. I believe that is among the such a lot important
    information for me. And i am satisfied studying your article.
    But wanna observation on few normal things, The web site style is perfect,
    the articles is in point of fact nice : D. Good activity, cheers

  14. You actually make it seem so easy with your presentation but I find this matter to be actually something that I think I would
    never understand. It seems too complex and extremely
    broad for me. I am looking forward for your next post, I will try to get the hang of it!

  15. Hello just wanted to give you a brief heads up and let you know a few of the
    images aren’t loading properly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different internet browsers and both
    show the same results.

  16. Hello there! Quick question that’s completely off topic.

    Do you know how to make your site mobile friendly?
    My web site looks weird when viewing from my iphone 4. I’m trying to
    find a theme or plugin that might be able to fix this issue.
    If you have any recommendations, please share. Cheers!

  17. I do not know if it’s just me or if everybody else experiencing issues with your
    website. It appears like some of the text within your posts are running off the screen. Can somebody else please comment and let me know if this is happening to them too?
    This might be a problem with my internet browser because I’ve
    had this happen previously. Kudos

  18. Aw, this was an extremely nice post. Spending some time and
    actual effort to generate a great article… but what can I
    say… I put things off a lot and don’t manage to get nearly anything done.

  19. Great goods from you, man. I have understand your stuff previous
    to and you are just extremely wonderful. I really like what you have
    acquired here, really like what you are saying and the way in which you say it.
    You make it enjoyable and you still care for to keep it sensible.
    I can not wait to read much more from you.
    This is actually a tremendous website.

  20. My programmer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the costs. But he’s
    tryiong none the less. I’ve been using WordPress on various websites
    for about a year and am anxious about switching to another platform.
    I have heard good things about blogengine.net. Is there a way I can transfer all my wordpress posts into it?
    Any help would be really appreciated!

  21. Hi there! This post couldn’t be written any better! Reading through this post reminds me of
    my good old room mate! He always kept talking about this.
    I will forward this post to him. Pretty sure he will have a good read.
    Thank you for sharing!

  22. Undeniably consider that which you said. Your favorite reason appeared to be at the
    web the simplest thing to be mindful of. I say to you, I certainly get irked at the same time as people consider issues
    that they plainly do not recognize about. You controlled to hit the nail upon the
    top and also defined out the entire thing with no need side-effects , other folks could take a signal.
    Will likely be again to get more. Thank you

  23. Its such as you read my mind! You seem to grasp a lot approximately this, like you wrote the e
    book in it or something. I believe that you simply
    could do with a few p.c. to drive the message house a little bit, but other than that,
    that is wonderful blog. A great read. I will certainly be back.

  24. Thanks for one’s marvelous posting! I truly enjoyed reading it, you are a great author.I will be sure to bookmark your blog and will often come back later in life.
    I want to encourage continue your great job, have a nice afternoon!

  25. It is perfect time to make some plans for the future and it’s time to be happy.

    I have read this post and if I could I want to suggest you
    some interesting things or tips. Perhaps you could write next articles referring to
    this article. I want to read more things about it!

  26. Hi there! I just wanted to ask if you ever have any trouble with hackers?
    My last blog (wordpress) was hacked and I ended up
    losing months of hard work due to no back up. Do you have any solutions to prevent hackers?

  27. Simply desire to say your article is as amazing. The clarity
    in your post is just great and i could assume you are an expert on this subject.
    Well with your permission let me to grab your RSS feed
    to keep updated with forthcoming post. Thanks a million and please
    continue the rewarding work.

  28. Howdy would you mind stating which blog platform you’re working
    with? I’m going to start my own blog in the near future but I’m having a tough time making
    a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m looking
    for something unique. P.S Sorry for getting off-topic but I had to ask!

  29. Very good blog you have here but I was curious if you knew of any community forums that cover the same topics discussed here?
    I’d really love to be a part of online community where I can get responses from other experienced individuals
    that share the same interest. If you have any suggestions, please let me know.


  30. Have you ever thought about including a
    little bit more than just your articles?
    I mean, what you say is important and everything. But think of if you added
    some great photos or videos to give your posts more, “pop”!
    Your content is excellent but with pics and clips, this blog could definitely be one of the best in its field.
    Superb blog!

  31. Wonderful beat ! I wish to apprentice while you amend your website, how could
    i subscribe for a weblog web site? The account helped me a applicable deal.
    I had been a little bit acquainted of this your broadcast offered brilliant clear idea

  32. Write more, thats all I have to say. Literally, it seems as though you relied on the
    video to make your point. You obviously know what youre talking about,
    why throw away your intelligence on just posting videos to your site when you could be giving us something enlightening to read?

  33. Sorry for my English.Great blog here! Also your site loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol.

  34. This is really interesting, You are a very skilled blogger. I ave joined your rss feed and look forward to seeking more of your fantastic post. Also, I ave shared your website in my social networks!

  35. Wow! This could be one particular of the most helpful blogs We ave ever arrive across on this subject. Actually Wonderful. I am also a specialist in this topic so I can understand your hard work.

  36. I blog quite often and I seriously appreciate your information. This article has really peaked my interest. I’m going to book mark your website and keep checking for new information about once per week. I opted in for your RSS feed as well.

  37. Wow! This can be one particular of the most useful blogs We ave ever arrive across on this subject. Basically Excellent. I am also an expert in this topic therefore I can understand your effort.

  38. Your style is really unique compared to other people I have read stuff from. Many thanks for posting when you have the opportunity, Guess I will just bookmark this page.

  39. Wonderful blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I ave been trying for a while but I never seem to get there! Many thanks

  40. Nice blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my site loaded up as fast as yours lol

  41. I simply could not depart your website before suggesting that I really enjoyed the usual information a person supply to your visitors? Is going to be again regularly in order to check up on new posts.

  42. Wow, amazing blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is fantastic, let alone the content!. Thanks For Your article about sex.

  43. My brother suggested I might like this website. He was totally right. This post actually made my day. You can not imagine just how much time I had spent for this information! Thanks!

  44. It is not acceptable just to think up with an important point these days. You have to put serious work in to exciting the idea properly and making certain all of the plan is understood.

  45. It’s a pity you don’t have a donate button! I’d definitely donate to this excellent blog!

    I suppose for now i’ll settle for book-marking
    and adding your RSS feed to my Google account.
    I look forward to fresh updates and will share this blog
    with my Facebook group. Talk soon!

  46. This is very interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your wonderful post. Also, I have shared your site in my social networks!

  47. Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn at appear. Grrrr well I am not writing all that over again. Anyways, just wanted to say superb blog!

  48. ItaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžs actually a great and useful piece of information. I am glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  49. Todavía es un tema tabú y, por eso, los afectados consultan poco con su médico. Suelen aparecer a partir de cierta edad, aunque también se suele dar en personas jóvenes. Los inhibidores de la fosfodiesterasa V no producen la erección, independientemente del deseo sexual, aunque intensifican la respuesta eréctil ante la estimulación sexual.

  50. Very nice post. I just stumbled upon your weblog and wished to say that I ave truly enjoyed browsing your blog posts. After all I will be subscribing to your feed and I hope you write again very soon!

  51. This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your excellent post. Also, I have shared your web site in my social networks!

  52. Very nice info and straight to the point. I don at know if this is actually the best place to ask but do you people have any ideea where to employ some professional writers? Thank you

  53. You have made some decent points there. I looked on the net for more information about the issue and found most individuals will go along with your views on this web site.

  54. Your style is so unique in comparison to other folks I ave read stuff from. I appreciate you for posting when you ave got the opportunity, Guess I will just book mark this web site.

  55. Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn at show up. Grrrr well I am not writing all that over again. Anyway, just wanted to say great blog!

  56. Usually I don at read article on blogs, but I wish to say that this write-up very compelled me to check out and do it! Your writing style has been amazed me. Thanks, very nice post.

  57. I was recommended this web position by my cousin. I am not sure whether this post is written by him as rejection one to boot get such detailed concerning my problem. You are amazing! Thanks!

  58. This unique blog is really awesome and diverting. I have chosen many useful things out of this amazing blog. I ad love to come back over and over again. Thanks!

  59. This blog is definitely interesting and also diverting. I have chosen a lot of useful things out of this source. I ad love to come back again soon. Thanks a bunch!

  60. Wow, amazing weblog format! How long have you ever been blogging for? you make running a blog glance easy. The full glance of your website is fantastic, as well as the content material!

  61. I?аАТ’аЂа†ll right away grasp your rss as I can not in finding your e-mail subscription hyperlink or newsletter service. Do you ave any? Please allow me recognize in order that I could subscribe. Thanks.

  62. Vielen Dank für die Großen Beitrag. Ich sind schon untersuchen dieses Sache für irgendwann . Die Waren und Besonderheiten Sie zeigen, ich war nicht bewusst. Ich werden nachfolgend Ihre Site jetzt und hoffentlich Sie werden viel mehr Gefühle und Einsichten.

  63. I?ve read several excellent stuff here. Definitely worth bookmarking for revisiting. I wonder how so much effort you put to make one of these fantastic informative website.

  64. I was very pleased to find this website. I wanted to thank you for your time for this wonderful post!! I definitely enjoy reading it and I have you bookmarked to check out new stuff you blog post.

  65. Please let me know if you are looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I ad love

  66. naturally like your web site but you need to check the spelling on quite a few of your posts. Several of them are rife with spelling problems and I find it very troublesome to tell the truth nevertheless I’ll certainly come back again.

  67. Excellent read, I just passed this onto a friend who was doing some research on that. And he just bought me lunch since I found it for him smile So let me rephrase that: Thanks for lunch!

  68. This blog is definitely rather handy since I’m at the moment creating an internet floral website – although I am only starting out therefore it’s really fairly small, nothing like this site. Can link to a few of the posts here as they are quite. Thanks much. Zoey Olsen

  69. Simply wish to say your article is as surprising. The clarity on your submit is simply nice and i can think you are knowledgeable on this subject. Well along with your permission let me to snatch your feed to stay up to date with forthcoming post. Thanks one million and please keep up the rewarding work.

  70. Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

  71. IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžm a lengthy time watcher and I just considered IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžd drop by and say hello there there for the very initially time.