Ask a Question | Answer a Question! |

Submitting your question...
ResFinder - Thousands of Practice Papers
code for happy no. is below
import java.io.*;
public class happyormagical
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a no.");
int n=Integer.parseInt(br.readLine());
int sum=n;
while(sum>9)
{
n=sum;
sum=0;
while(n>0)
{
int rem=n%10;
sum=sum+rem*rem;
n=n/10;
}
}
if(sum==1)
System.out.println("Happy no.");
else
System.out.println("Not a Happy no.");
}
} |
 |
| asked by Bhavesh Choudhari (bhavesh988) 9 years ago |
1 |
Other Questions on This Topic
What is the capital of Manipur? |
 |
| asked by Yogesh (yogesh) 2 years ago |
1 |
guys pls suggest some good ways to go watch oppenheimer as it a rated. im 15 yr old and will be going in 15 person group together to watch the amazing movie. i know this is not the space to ask but pls help. Will be very grateful for any help. Yar idhar tak padh liya to kuch to bata hi do |
 |
| asked by Dhruv Shah (maihudhruvvvvvv) 2 years ago |
0 |
Hydrochloric acid turns pink coloured potassium permanganate to which colour? |
 |
| asked by Vivanth (vivanth1420) 8 years ago |
1 |
how to find vegetation of the given toposheet |
 |
| asked by Pavan Sd (pavansd) 8 years ago |
1 |
i got 99% if any 1 wnt any hlp or crash course ..contact 7044922566. without any charges |
 |
| asked by Ankit Kumar (ajjjj58) 8 years ago |
0 |
hi i got 98% in boards
if anyone has any doubts then please f*** off |
 |
| asked by Unknown (unknown2001) 8 years ago |
0 |
How to distinguish between narrative and descriptive |
 |
| asked by Smitha Menon (mythilimenon) 8 years ago |
0 |
I scored 96.2 in boards. Message me if you require any help :) |
 |
| asked by Agrim (alan1) 9 years ago |
2 |
hey i really want to get 95% please help me out what am i supposed to do for my boards!! |
 |
| asked by Riddhi Jain (olive1909) 9 years ago |
|