?? program4_08.c
字號:
/* Program 4.8 While programming and summing integers */
#include <stdio.h>
int main(void)
{
long sum = 0L; /* The sum of the integers */
int i = 1; /* Indexes through the integers */
int count = 0; /* The count of integers to be summed */
/* Get the count of the number of integers to sum */
printf("\nEnter the number of integers you want to sum: ");
scanf(" %d", &count);
/* Sum the integers from 1 to count */
while(i <= count)
sum += i++;
printf("Total of the first %d numbers is %ld\n", count, sum);
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -