c语言求1-10之间mm所有奇数和的程序

如题所述

int sum=0;
for(int i=1; i<=10; i++)
  if (i%2) sum +=i;
printf("sum=%d", sum);
温馨提示:答案为网友推荐,仅供参考
相似回答