Erster Commit

This commit is contained in:
2026-09-24 14:39:54 +02:00
commit dc05214087
245 changed files with 20517 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
#include <stdio.h>
// n-th term of an Arithmetic Sequence
// an = a1 + (n-1)*d
int main(void) {
int startValue, distValue, numOfValues, result;
printf("Hello to your n-th Term calculation!\n");
printf("Enter start value: ");
scanf("%d", &startValue);
printf("Enter the distance between the values: ");
scanf("%d", &distValue);
printf("Enter the number of calculations: ");
scanf("%d", &numOfValues);
result = startValue + (numOfValues -1) * distValue;
/*
for (int i = 0; i < numOfValues ; ++i) {
result = startValue;
printf("%d ", result);
startValue += distValue;
}
*/
printf("\nThe n-th term is: %d\n",result);
return 0;
}