c5-3-1.c 174 B

1234567891011121314
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i,sum=0;
  5. printf("please enter i,i=?");
  6. scanf("%d",&i);
  7. while(i<=10)
  8. {
  9. sum=sum+i;
  10. i++;
  11. };
  12. printf("sum=%d\n",sum);
  13. return 0;
  14. }