在C语言中,字符型数据在内存中以( )形式存放
#include
int main()
{
int a = 5, b = 4, x, y;
x = 2 * a++;
y = --b * 2;
printf("a=%d, x=%d\n", a, x);
printf("b=%d, y=%d\n", b, y);
return 0;
}
#include
int main()
{
int a;
int c=10;
float f=100.0;
double x;
a=f/=c*=(x=6.5);
printf("%d,%d,%3.1f,%3.1f\n",a,c,f,x);
return 0;
}
#include
int main()
{
char a,b;
int s;
printf("please input a and b:\n");
a=getchar();
b=getchar();
s=a+b;
printf("a=%c,b=%c",a,b);
return 0;
}
程序运行时从键盘输入:12
#include
int main()
{
int a,b,c,d;
scanf("%c%c%d,%d",&a,&b,&c,&d);
printf("%c,%c,%c,%c\n",a,b,c,d);
return 0;
}
若运行以上程序时从键盘上输入:6565,66。则输出结果是
#include
int main()
{
int a,b,s;
scanf("%2d%2d",&a,&b);
s=a/b;
printf("s=%d",s);
return 0;
}
#include
int main()
{
int a=666,b=888;
printf("%d\n",a,b);
return 0;
}
#include
int main()
{
int a;
int c=10;
float f=100.0;
double x;
a=f/=c*=(x=6.5);
printf("%d,%d,%3.1f,%3.1f\n",a,c,f,x);
return 0;
}
#include
int main()
{
int a=1234;
printf("%2d\n",a);
return 0;
}
#include
int main()
{
float a = 1234.567,b = 55.32;
printf("a = %4.2f, b = %5.1f\n", a,b);
return 0;
}
#include int main() { char a,b; int s; printf("please input a and b:\n"); a=getchar(); b=getchar(); s=a+b; printf("a=%c,b=%c",a,b); return 0; }