题目
若运行时输入:4.4<回车>,则以下程序的运行结果是________。#include <stdio.h>void main(void)(float CostPrice,SellingPrice;printf(“Enter Cost Price :”);scanf(“%f”,CostPrice);if(CostPrice>=5){SellingPrice=CostPrice+CostPrice*0.25;printf(“Selling Price(0.25)%6.2f”,SellingPrice);)else(SellingPrice=CostPrice+CostPrice*0.30;printf(“Selling Price(0.30)%6.2f”,SellingPrice);)}
若运行时输入:4.4<回车>,则以下程序的运行结果是________。
#include <stdio.h>
void main(void)
{
float CostPrice,SellingPrice;
printf(“Enter Cost Price $:”);
scanf(“%f”,CostPrice);
if(CostPrice>=5)
{
SellingPrice=CostPrice+CostPrice*0.25;
printf(“Selling Price(0.25)$%6.2f”,SellingPrice);
}
else
{
SellingPrice=CostPrice+CostPrice*0.30;
printf(“Selling Price(0.30)$%6.2f”,SellingPrice);
}
}
题目解答
答案
Selling Price(0.30)$5.72