计算季度的总收入并输出

#include <stdio.h>

int main(void)
{
  const float Revenue_Per_150 = 4.5f;
  unsigned int PC =11111110;                           // Stock sold in January
  unsigned int Memory =22222220;                           // Stock sold in February
  unsigned int Keyboard =33333330;                           // Stock sold in March
  float  RevQuarter = 0.0f;                                // Sales for the quarter

  unsigned long QuarterSold = PC + Memory + Keyboard; // Calculate quarterly total

  printf("Stock sold in/n Jan: %d/n Feb: %d/n Mar: %d/n", PC, Memory, Keyboard);
  printf("Total stock sold in first quarter: %ld/n", QuarterSold);


  RevQuarter = QuarterSold / 150 * Revenue_Per_150;
  printf("Sales revenue this quarter is:$%.2f/n", RevQuarter);
  return 0;
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266682.html

(0)
上一篇 2022年6月7日
下一篇 2022年6月7日

相关推荐

发表回复

登录后才能评论