Skip to content
WikiCoders.OrgWikiCoders.Org
  • Covid19 Live Tracking
  • Cheat Sheets
  • Programming
    • C Programs
      • Basic Programs
      • Array In C
      • Number System In C
      • Recursion In C
      • Unions In C
      • Linked List in C
    • C ++
      • Basics in C++
      • Loops in C++
  • About Us
  • Contribute
  1. Home
  2. /
  3. C ++

Loops in C++

  1. Loops in C++

C++ Program to Find Factorial

For any positive number n, it’s factorial is given by: factorial = 1*2*3...*n Factorial of negative number cannot be found and factorial of 0 is 1. Program #include <iostream> using namespace std; int main() { unsigned int n; unsigned long long factorial = 1; cout << "Enter a positive integer: "; cin >> n; for(int […]
  1. Loops in C++

C++ Program to Calculate Sum of Natural Numbers

Program #include <iostream> using namespace std; int main() { int n, sum = 0; cout << "Enter a positive integer: "; cin >> n; for (int i = 1; i <= n; ++i) { sum += i; } cout << "Sum = " << sum; return 0; } Output Enter a positive integer: 50 Sum […]

Best Sellers in Software @ Amazon

Categories

  • Blog
  • C Programs
    • Number System In C
    • Basic Programs
    • Recursion In C
    • Array In C
    • Unions In C
    • Linked List in C
  • C ++
    • Basics in C++
    • Loops in C++
  • DataStructure
  • MongoDB
  • Cheat Sheets

Categories

Pages

  • About Us
  • All Posts
  • Contact
  • Contribute
  • Coronavirus Live Real Time Stats Update
  • Perks and Offers
  • Privacy Policy
  • Profile
  • WikiCoders
  • Covid19 Live Tracking
  • Cheat Sheets
  • Programming
    • C Programs
      • Basic Programs
      • Array In C
      • Number System In C
      • Recursion In C
      • Unions In C
      • Linked List in C
    • C ++
      • Basics in C++
      • Loops in C++
  • About Us
  • Contribute

Made with ❤ in India