Skip to main content

Posts

Showing posts from December, 2019

#Strongnumber #nareshit #Hyderabad Write a program to find Strong numb...

Interview Question (Coding) ========================================================== 2.Write a program to find strong number -->If a number every digit factorial sum is equal to this number that called strong number Example- Example- input- 145 input-123 1!+4!+5!=145; 1!+2!+3!=9 output-Strong no output:Not Strong no Sourse cod: class Strongno { public static int fact(int n){ int f=1; for(int i=n;i>0;i--){ f=f*i; } return f; } public static void main(String[] args) { int n=157; int sum=0,m=n; while(n!=0){ sum=sum+fact(n%10); n=n/10; } if(sum==m) System.out.println("Strong no"); else System.out.println("Not Strong no"); } }

#Webservise #jacksonAPI How to add Jackson API In eclipse and STS ID. An...

package com.app; import org.codehaus.jackson.map.ObjectMapper; public class Student {   private int sid;   private String sname;  public int getSid()  {  return sid;   }   public void setSid(int sid) {   this.sid = sid;   }   public String getSname() {   return sname;  }  public void setSname(String sname) { this.sname = sname;   }   } package com.app; import org.codehaus.jackson.map.ObjectMapper; public class Test { public static void main(String[] args) { try { Student s=new Student(); s.setSid(10); s.setSname("prince"); ObjectMapper om=new ObjectMapper(); String json=om.writeValueAsString(s); System.out.println(json); } catch (Exception e) { e.printStackTrace(); } } }

#WhileLoop #while #working How to work while loop and decided to used ||...

C Loops: For, While, Do While, Break, Continue with Example What are Loops? In looping, a program executes the sequence of statements many times until the stated condition becomes false. A loop consists of two parts, a body of a loop and a control statement. The control statement is a combination of some conditions that direct the body of the loop to execute until the specified condition becomes false. In this tutorial, you will learn- What are Loops? Types of Loops While Loop Do-While loop For loop Break Statement Continue Statement Which loop to Select? Types of Loops Depending upon the position of a control statement in a program, a loop is classified into two types: 1. Entry controlled loop 2. Exit controlled loop In an entry controlled loop, a condition is checked before executing the body of a loop. It is also called as a pre-checking loop. In an exit controlled loop, a condition is checked after executing the body of a loop. It is also called as a post-c

FIND THE UNIQUE ELEMENTS IN ARRAYS || COUNT DUPLICATES ELEMENT IN ARRAY||

import java.util.*; class FindNumberOFDuplicate  {    //Write a program to find the unique element in arrays. public static void main(String[] args)  { int c=0; int arr[]={10,20,20 ,30,40,50,10,20}; System.out.println("Original:"+Arrays.toString(arr)); System.out.print("Unique Element:"); for(int i=0;i<arr.length;i++){            int j;           for( j=0;j<i;j++){             if(arr[i]==arr[j]){ c++; break; }   }   if(i==j){            System.out.print(arr[i]+"  ");   } } System.out.print("\nCount Duplicate:"+c); System.out.println(); } } 2. A second method to find the unique element in the array.      import java.util.*; class Unique2{   public static void main(String args[]){             int arr

#interview #Question #job #interview #fresher Written test interview que...

class BinaryToDecimal { //Binary to Decimal Conversion in java lanfuage public static void main(String[] args) { int n=1111,rem=0,base=1; int decimal=0; System.out.println("Binary Number:"+n); while(n!=0){ rem=n%10; n/=10; decimal=decimal+rem*base; base=base*2; } System.out.println("Decimal Number:"+decimal); } }

#nareshit #interview #questions Interview Questions for freshers 2020/2...

Interview Question Naresh it Hyderabad Campous ================================================= 1.Find the sub string and remove it .if it's not avilable than return -1; For example you have a 2 String Input: String s1="abc"; String s1="pqr"; String s2="princeabckumar"; String s2="abcdefg"; output=princekumar output=-1; 2. Check the given number is palindrome or not. if given no is palindrome number than print the digit of the sum given no if it's not palindrome number than print digit of the product of the given number. For example: input: 2112 input=1234 output=6 output=24 Top 50+ Core Java Interview Questions And Answers Last Updated:November 12, 2019 Most Frequently asked Java Interview...

#interview #Question Coding challenge of MNC Company's also an interview...

Improve your Coding Skills & Become a Better Developer Coderbyte is the #1 website for technical interview prep and coding challenges START THE FIRST CHALLENGE → Prepare for coding interviews from leading tech companies with our interview prep material. VIEW COURSES → Improve your coding skills with our library of 500+ challenges. VIEW CHALLENGES → Become a better developer with Coderbyte. Here's why 300,000+ programmers have taken the journey with us. Get the job Interview prep for leading tech companies Learn how others would answer a question Custom improvement recommendations Predictive interview success scores Improve your skills Practice with 500+ challenges Access to actual interview questions Learn from senior developers Discuss solutions with the community Thanks for making Coderbyte! Your JavaScript challenges are the best way our applicants can test if they are ready for their interviews. — Alessandro Zanardi, CEO of Codeworks I began my ...