摘要: 题目:宏#define命令练习。 程序分析:无。 实例: 1 #include<stdio.h> 2 #define TRUE 1 3 #define FALSE 0 4 #define SQ(x) (x)*(x) 5 int main() 6 { 7 int num; 8 int again=1; 阅读全文
posted @ 2020-06-12 21:17 C语言自学网 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目:学习使用register定义变量的方法。 程序分析:无。 实例: 1 #include <stdio.h> 2 int main() 3 { 4 register int i; 5 int tmp=0; 6 for(i=1;i<=100;i++) 7 tmp+=i; 8 printf("总和为 阅读全文
posted @ 2020-06-12 21:16 C语言自学网 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 题目:学习使用external的用法。 程序分析:无。 实例: 1 #include <stdio.h> 2 int a,b,c; 3 void add() 4 { 5 int a; 6 a=3; 7 c=a+b; 8 } 9 int main() 10 { 11 a=b=4; 12 add(); 阅读全文
posted @ 2020-06-12 21:14 C语言自学网 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 题目:学习使用static的另一用法。 程序分析:无。 实例: 1 #include <stdio.h> 2 int main() 3 { 4 int i,num; 5 num=2; 6 for(i=0;i<3;i++) 7 { 8 printf("num 变量为 %d \n",num); 9 nu 阅读全文
posted @ 2020-06-12 21:12 C语言自学网 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目:学习使用auto定义变量的用法。 程序分析:无。 实例: 1 #include <stdio.h> 2 int main() 3 { 4 int i,num; 5 num=2; 6 for(i=0;i<3;i++) 7 { 8 printf("num 变量为 %d \n",num); 9 nu 阅读全文
posted @ 2020-06-12 21:11 C语言自学网 阅读(328) 评论(0) 推荐(0) 编辑