TAILIEUCHUNG - Lecture Introduction to computer and programming - Lecture No 5

In this chapter, the following content will be discussed: Assembly language programming - Moving up a level, an assembly language program, the assembly process, beyond the assembly of a single assembly language program. | CSC103: Introduction to Computer and Programming Lecture No 5 Previous lecture A first C program Comments Single line Multi line Preprocessor directive main() function keywords Program statement Today’s lecture outline Escape sequences C compiler Directives Common errors Components of C Program /* C Programming for the Absolute Beginner */ //by Michael Vine #include main() { printf("\n C you later \n") ; } multi-line comment block single line comment block preprocessor directive standard input output library begin logical program block end logical program block program statement program statement terminator printf function escape sequence Escape Sequence Escape sequences are specially sequenced characters used to format output printf("\nC you later\n"); This printf() function adds two new lines for formatting purposes. Before text is shown, the program outputs a new line. After the text is written to standard output. Escape Sequence \n printf("line 1\nline2\nline3\n"); line 1 line 2 line 3 _ printf("C "); printf("for the "); printf("Absolute Beginner\n"); C for the Absolute Beginner _ Go to Program Escape Sequence \t Escape sequence \t moves the cursor to the next tab space. printf("\nSun\tMon\tTue\tWed\tThu\tFri\tSat\n"); printf("\t\t\t\t1\t2\t3\n"); printf("4\t5\t6\t7\t8\t9\t10\n"); printf("11\t12\t13\t14\t15\t16\t17\n"); printf("18\t19\t20\t21\t22\t23\t24\n"); printf("25\t26\t27\t28\t29\t30\t31\n"); Go to Program Escape Sequence \r printf("This escape sequence moves the cursor "); printf("to the beginning of this line\r"); printf("This escape sequence moves the cursor \r"); printf("to the beginning of this line"); This escape sequence moves the cursor to the beginning of this line to the beginning of this line cursor Go to Program Escape Sequence \\ Escape sequence \\ inserts a single backslash \ in your text. When a program reads a backslash in a printf() function, it expects to see a valid escape character right after it. Backslash character (\) is a

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.