Friday, 6 January 2017

Write a program to check whether a number is perfect or not ?

Question : Write a program to check whether a number is perfect or not ?

(A number said to be  perfect if sum of all factor  less than given number then equal to given number)
Input : 6
Output : Perfect Number

Write a program to check whether given number is Magic or not?

Question : Write a program to check whether given number is Magic or not?

A Magic number said to be a magic when we add each digit until its reached less than 10 after that  if value is 1 then number is Magic.
Example :
    28 = 2+8
         =10
     10= 1+0
         =1 

Write a program to find the following pattern ?

Question : Write a program to find the following pattern?

input : Ashok Kumar Yadav
Output: A.K. Yadav

Write a program that accept two string one for main string and second string will store some word and remove this word form main string?

Question : Write a program that accept two string one for main string and second string will store some word and remove this word form main string?

Input : ram is a good boy
Search string : ram good
Output : is a boy

Solution : 

import java.util.*;