课程
/后端开发
/C
/C语言入门
//将c赋值给n
2018-12-18
源自:C语言入门 2-8
正在回答
char c = 'a';
int n = c; 字符类型可以自动转换为整型 //将c赋值给n
float f = (float)c; //将c赋值给f
double d = (double)c; //将c赋值给d
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
举报
C语言入门视频教程,带你进入编程世界的必修课-C语言
2 回答char c = 'a'; int n = c ; //将c赋值给n float f = c ; //将c赋值给f double d = c; //将c赋值给d printf("%d\n",n); printf("%f\n",f); printf("%lf\n",d); return 0; }
2 回答#include <stdio.h> int main() { char c = 'a'; int n = c; //将c赋值给n float f = c; //将c赋值给f double d = c; //将c赋值给d printf("%d\n",n); printf("%f\n",f); printf("%lf\n",d); return 0; }
1 回答#include <stdio.h> int main() { char c = 'a'; int n =c; //将c赋值给n float f =c; //将c赋值给f double d =c; //将c赋值给d printf("%d\n",n); printf("%f\n",f); printf("%lf\n",d); return 0; }
1 回答#include <stdio.h> int main() { char c = 'a'; int n = c ; //将c赋值给n float f = c ; //将c赋值给f double d = c ; //将c赋值给d printf("%d\n",n); printf("%f\n",f); printf("%lf\n",d); return 0; }
4 回答#include <stdio.h> int main() { char c = 'a'; int n = c ; //将c赋值给n float f = c; //将c赋值给f double d = c; //将c赋值给d printf("%d\n",n); printf("%f\n",f); printf("%lf\n",d); return 0; }