From 3c87bc84b548ba8d5a140babc8eec80aea100c84 Mon Sep 17 00:00:00 2001 From: ashwek Date: Tue, 12 Feb 2019 18:44:56 +0530 Subject: [PATCH] Removed Others/Happy_number.cpp Updated versions exists at / --- Others/Happy_number.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 Others/Happy_number.cpp diff --git a/Others/Happy_number.cpp b/Others/Happy_number.cpp deleted file mode 100644 index f3571ac34..000000000 --- a/Others/Happy_number.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* A happy number is a number whose sum of digits is calculated until the sum is a single digit, - and this sum turns out to be 1 */ -#include -using namespace std; -int main() -{ - int n,k,s=0,d; - cout << "Enter a number:"; - cin >> n; - s=0;k=n; - while(k>9) - { - while(k!=0) - { - d=k%10; - s+=d; - k/=10; - } - k=s; - s=0; - } - if(k==1) - cout << n << " is a happy number" << endl; - else - cout << n << " is not a happy number" << endl; -}