Computer Science, asked by Knk1234, 3 months ago

Write a program to find whether the number is a happy number or not with variable table

Answers

Answered by JBJ919
0

Answer:

  • #include <stdio.h>
  • //isHappyNumber() will determine whether a number is happy or not.
  • int isHappyNumber(int num){
  • int rem = 0, sum = 0;
  • //Calculates the sum of squares of digits.
  • while(num > 0){
  • rem = num%10;
  • sum = sum + (rem*rem);

Similar questions