Requirement: Use do...while statement to find the cumulative sum from 1 to 100
Answer:
(Recommended learning:c language video tutorial)
#include void main() { int sum=0; int i=1; do { sum=sum+i; i++; }while(i<=100); printf("do_while循环结果:%d\n",sum); }
Recommended related article tutorials: c language tutorial
The above is the detailed content of How to use do...while statement to find the cumulative sum from 1 to 100 in C language. For more information, please follow other related articles on the PHP Chinese website!