编程学习网为您整理以下代码实例,主要实现:输入值乘法,希望可以帮到各位朋友。
#include <stdio.h>
#include <stdlib.h>
int main()
{
float height_in_cm;
char height_in_inches[4];
printf("Enter your height in inches:");
gets_s(height_in_inches);
height_in_cm = atoi(height_in_inches)*2.54;
printf("You are %.2f centimeters tall.\n",height_in_cm);
return(0);
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!