编写程序:
#include"stdio.h"
#include<conio.h>
void main()
{
char ch1 = 'A', ch2 = 'B', chTemp;
printf("ch1=%c,ch=%c\n", ch1, ch2);
chTemp = ch1;
ch1 = ch2;
ch2 = chTemp;
printf("ch1=%c,ch2=%c\n", ch1, ch2);
int n = getchar();
}
代码运行结果:
编写程序:
#include"stdio.h"
#include<conio.h>
void main()
{
char ch1 = 'A', ch2 = 'B', chTemp;
printf("ch1=%c,ch=%c\n", ch1, ch2);
chTemp = ch1;
ch1 = ch2;
ch2 = chTemp;
printf("ch1=%c,ch2=%c\n", ch1, ch2);
int n = getchar();
}
代码运行结果: