1 / 17

FORMAL LETTER

FORMAL LETTER. Fahri bin Fahmi No2 Jalan Masjid 35900 Proton City, Tanjung Malim --------------------------------------------------------------------------------------------------------- Cikgu Rohani binti Kadir SMK Proton City

Download Presentation

FORMAL LETTER

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FORMAL LETTER Fahri bin Fahmi No2 JalanMasjid 35900 Proton City, TanjungMalim --------------------------------------------------------------------------------------------------------- CikguRohanibintiKadir SMK Proton City 35900 Proton City, TanjungMalim 25 January 2010 Dear teacher, ABSENT To refer as above, I can’t attend to the school for 2 days (21 and 22 January 2010) because I am not feeling well. I will be back to school on 25 January 2010. Thank you. Yours sincerely, Fahri bin Fahmi

  2. UNIT 4.3 FUNDAMENTALS OF C LANGUAGE 4.3.1 STRUCTURE OF C PROGRAMS

  3. LEARNING OBJECTIVES : • At the end of this lesson, students should be able to : • Explain the structure of C programs  Write the simple program using C language

  4. INTRODUCTION C Language :  programming language developed at AT&T Bell laboratories by Dennis Ritchi.  named C because it followed an earlier PL named B.  structured language as it enforces a logical structure in the program  Reliable, simple and easy to use • PL have words, symbols and rules (known as the syntax)

  5. 4.3.1 STRUCTURE OF C PROGRAMS <comment entry> <preprocessor directives> main() { <declarations>; <C statements>; }

  6. Comments • Can be placed anywhere /* This is a comment */ • Nested comments will be flagged as errors by the compiler. /*/* This is a wrong comment */*/

  7. Preprocessor Directive • Syntax : #include <filename> • Example : #include <stdio.h> • stdio.h : will include all standard input-output functions • #include < conio.h>

  8. main() • The most important function, which must be present in all the programs. • Programs will always start executing from this function. • A program can have only one main() function.

  9. { • Stated the starting for main function • Every function must have at least one pair block opener ( { ) and closer ( } )

  10. Variable Declaration • All the variables that are used in a program must be declared. • Example : int x, char a, float mark data type variable

  11. C Statements Printf (“I’m a good girl”) • Displays the specified string on the screen. Scanf (“%d”, age)  To get the value from the user clrscr() • Will clear the screen content.

  12. C PROGRAM Example 1 /* First day to school*/ #include<stdio.h> main() { int a; printf (“Enjoy the first day”); }

  13. Example 2 /* Learn C program*/ #include<stdio.h> main() { printf (“It’s so easy programming language”); }

  14. Example 3 /*Easy number*/ #include <stdio.h> main() { int x; /*variable declared*/ printf (“\n Enter a number =”); Scanf (“%d”, x); /*user enter a number*/ }

  15. CONCLUSION

  16. What is the C structure components? • How to build up the C program?

  17. MutiaraKata “Bukansemuaorangbodohitubodoh, sebenarnyadiabodohkeranamembenarkandirinyauntukmenjadibodoh” “Kita tidakperlumenyesalkalauorang lain tidakmengetahuipengetahuankita, kitaharusbersusahhatikalaukitatidakmengetahuipengetahuanorang lain” -Dr. HM TuahIskandar Al-haj

More Related