大连东软信息学院大一上 电子工程 c语言-实验doc第一次,第二周_第1页
大连东软信息学院大一上 电子工程 c语言-实验doc第一次,第二周_第2页
大连东软信息学院大一上 电子工程 c语言-实验doc第一次,第二周_第3页
大连东软信息学院大一上 电子工程 c语言-实验doc第一次,第二周_第4页
大连东软信息学院大一上 电子工程 c语言-实验doc第一次,第二周_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Lab 1Getting Started with C Programming in TurboCOBJECTIVESAfter completing this experiment, you will be able to:l code C programs in TurboCl compile and run C programs in TurboCl save C programs in TurboCl load C programs into TurboCl build a simple C program in TurboCl debug simple C programs in T

2、urboCl use hot keys of TurboCPROCEDURESPART 1 Code a C Program1. Run TurboC Development Environment.2. Use FileàNew to open a new file.3. Edit a C program as follows:#include <stdio.h>main()int a,b; a = 251;   b = 8; printf("%dn", a*b);PART 2 Compile and Run a C progra

3、m 1. Press Ctrl and F9 keys at the same time to compile and run a C program.If error occurs, modify the program, compile and run it again.2. Press Alt and F5 keys at the same time to switch to the user screen to get the result.If the result is not 2008, modify the program, compile and run it again.T

4、IP:Press Esc key to return to the edit screen.Print Screen of Result: 1 mark PART 3 Save a C program1. Press F2 key to save a C program.2In the input box shown below, input a file name with .c extension (e.g. first.c). 3. Press Enter key to save the file.PART 4 Load a C program1. Press F3 key to loa

5、d a C program in the default path of TurboC, e.g. C:DISK_CTC20, D:turboc2.2. Input the program name (e.g. first.c) to be loaded in the input box.3. Press Enter key to load the file.If error occurs, check the file name and check the default path to make sure whether the name is right and the program

6、is over there. What is the default path of the TurboC in your computer? 1 markPART 5 Build a C programCreate a C program that displays your student id and name (Pin Yin) on the screen. Make differences by using Escape Sequence in table 1.2 in page 11, e.g. n, t, etc.1. Write the C program.Print Scre

7、en of Code: 6 marks2. Save it using .c extension.3. Compile and run it using Ctrl and F9 keys.4. Check result using Alt and F5 keys.5. If error occurs, modify the program, save it, recompile and run it again.Print Screen of Result: 2 marksPART 6 Debug a Simple C ProgramCopy programs error1.c,error6.

8、c in directory “error1-6” to the default path of TurboC, load and debug them one by one.1. Debug error1.c and read the error prompts.Print Screen of Code: 1 mark2. Debug error2.c and read the error prompts.Print Screen of Code: 1 mark3. Debug error3.c and read the error prompts.Print Screen of Code:

9、 1 mark4. Debug error4.c and read the error prompts.Print Screen of Code: 1 mark 5. Debug error5.c and read the error prompts.Print Screen of Code: 1 mark6. Debug error6.c and modify the program to displayPrint Screen of code: 5 marksPART 7 Use Hot Keys in TurboCl Ctrl + F9Compile and runl Alt + F5Switch to User Screenl F2Save a programl F3Load a

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论