/*源程序:exp5_2.cpp*/
#include<stdio.h>
void main()
{ int i=1;
int sum=0;
while(i<=100)
{sum=sum+i;
i++;
}
printf("sum=%d\n",sum);
}
#include<stdio.h>
void main()
{ int i=1;
int sum=0;
while(i<=100)
{sum=sum+i;
i++;
}
printf("sum=%d\n",sum);
}