c语言程序代码.docVIP

  • 10
  • 0
  • 约7.05千字
  • 约 23页
  • 2021-07-18 发布于山西
  • 举报
word可编辑·实用文档 要求在屏幕上输出下一行信息。 This is a c program. 程序: #includestdio.h int main() { printf(“this is a c program.\n”); return 0; } 求两个整数之和。 程序: #includestdio.h int main() { int a,b,sum; a=122; b=234; sum=a+b; printf(“sum is %d\n”,sum); return 0; } 求两个整数之间的较大者。 程序: #includestdio.h int main() { int max(int x,int y); int a,b,c; scanf(%d,%d,a,b); c=max(a,b); printf(max=%d\n,c); return 0; } int max(int x,int y) { int z; if(xy)z=x; else z=y; return(z); } 有人用温度计测量出华氏发表示的温度(如69°F) ,今要求把她转换成以摄氏法表示的温度(如20℃)。 公式:c=5(f-32)/9. 其中f代表华氏温度 ,c代表摄氏温度。 程序: #includestdio.h int main() { float f,c; f=64.0; c=(5.0/9)*

文档评论(0)

1亿VIP精品文档

相关文档