Skip to main content

Posts

Showing posts with the label Repotation company

Repotation.com Programming Question in java || Logical Question in Written Test

All Programming Question in Written test  Repotation.com ===============================================================================================================================================  Q.1- ============   Input: 9876565  Expected Output is: 1 Hint:9+8+7+6+5+6+5=10 =1  Input is Possitive Number Only. Coading Part:        //Q.1 import java.util.Scanner; class ClassA  {    public static void main(String[] args)  { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sum=0,rem=0; while(true){ sum=0;            while(n!=0){              rem=n%10; sum=sum+rem; n/=10;    }    if(sum<10){               System.out.println(sum); break;   }   n=sum; } } } ====================================================================== Q.2- =========== Input :"for{do{print}}" Output: balanced Input:"while{do}a=5}"  Output:Unbalanced Coading Part: