C
xxxxxxxxxx
int addNumbers(int n);
int main() {
int num;
printf("Enter a positive integer: ");
scanf("%d", &num);
printf("Sum = %d", addNumbers(num));
return 0;
}
int addNumbers(int n) {
if (n != 0)
return n + addNumbers(n - 1);
else
return n;
}
Enter a positive integer: 20 Sum = 210
Linux - كيفية تثبيت anc-api-tools
Linux - كيفية تثبيت curvedns
Python - تحقق مما إذا كان الرقم موجبًا أم سالبًا أم 0
Linux - كيفية تثبيت zenmap
C - عد عدد الأرقام في عدد صحيح
C++ - تحقق مما إذا كان الرقم أوليًا أم لا
C++ - تحقق من السنة الكبيسة
JavaScript - تحقق مما إذا كانت السلسلة تبدأ وتنتهي بأحرف معينة
C - ابحث عن أكبر رقم باستخدام تخصيص الذاكرة الديناميكي
Kotlin - تقريب رقم إلى n منازل عشرية
Linux - كيفية تثبيت zfs-test
Kotlin - عكس رقم
C++ - البحث عن الحاصل والباقي
Linux - كيفية تثبيت xbitmaps
Java - عكس رقم
Kotlin - أوجد عاملي العدد
Linux - كيفية تثبيت zstd
GoLang - نطاق
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month