1 / 6

熟悉 TC2.0 编程环境

熟悉 TC2.0 编程环境. 教材 P44 2.2 Turbo C 集成开发环境,按序阅读实验,掌握 新建文件 File/New 打开文件 File/Open 保存文件 File/Save , File/Write to 调试文件 F8 教材 P70 习题 2.2 2.3 2.4 2.5 ,根据上面的步骤学习如何跟踪调试程序. 在 TC 环境中输入下面的代码 ,编译成功后保存到 E:1-2.c main() { int n,i; scanf("%d",&n); for(i=1;i<=n;i++)

dai-chan
Download Presentation

熟悉 TC2.0 编程环境

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. 熟悉TC2.0 编程环境 • 教材P44 • 2.2 Turbo C集成开发环境,按序阅读实验,掌握 • 新建文件 File/New • 打开文件 File/Open • 保存文件 File/Save , File/Write to • 调试文件 F8 • 教材P70习题 2.2 2.3 2.4 2.5,根据上面的步骤学习如何跟踪调试程序

  2. 在TC环境中输入下面的代码 ,编译成功后保存到E:\1-2.c main() { int n,i; scanf("%d",&n); for(i=1;i<=n;i++) { if(i%2==1) printf("*******%d\n",i); else printf("%d*******\n",i); }

  3. 熟悉VC++6.0 编程环境 • 《大学程序设计C实践手册》P3~P7熟悉VC++环境 • 在VC++中输入教材P70:习题2.1并运行,写出程序运行结果。 • 输入教材P26 图1-9中的程序并运行查看结果。

  4. 在VC++环境中输入下面的代码 ,编译运行成功后保存到e:\1-1.c • #include <stdio.h> • main() • { • int m, i, j; • for ( i=1; i<=5; i++ ) • { • scanf( "%d", &m ); • for ( j=1; j<=2*(5-m); j++ ) • printf( " " ); • for ( j=1; j<=m; j++ ) • { • printf( "%d", m ); • if ( j<m ) • printf( " " ); • } • printf( "\n" ); • } • } • /*运行到程序窗口时请输入:3 5 1 4 2,观察程序运行结果*/

  5. 第三章基础练习 () 1 写出标准c的四种基础数据类型。 2 常量:描述在程序运行中值不发生变化的数据。请挑出下列常量中合法的描述。 ‘a’,‘\n’, ’\x1f’ ,’\101’,’\018’,’\ab’, ”a’’, 0x123,0239, ‘’0’’,123,e9,1e2.2 3 变量名命名规则:字母或下划线开头,后面跟字母、下划线或数字,关键字不可用。挑出下面描述中合法的变量名。 IF , INT , int , 1abc23 ,abc23, _abc23, p-q, _123,

  6. 写出下列逻辑表达式 1) 年份用y表示,写出y是闰年的表达式 2) 整数x在y和z之间(!!!) 3) 整数n是偶数但不能被3整除 4) 字符c是一个数字式字符 5) 字符c是一个英文字母 • 写出下列数学表达式 1) 写表达式实现实数x的四舍五入 2) 写一个表达式使得实数x在小数点后第三位四舍五入 3) 写一个表达式描述实数x的整数部分 4) 分别写表达式提取整数n的个位数、十位数、百位数。。。 • 教材P91 3.8 3.10 3.11 3.15 3.16

More Related