Skip to main content

Posts

Interview Coding Question For software developer in all language || Written test question in exam of developer

Interview Coding Question For  software developer in all language || Written test question in exam of developer ==================================== Write a Java program to perform input/output of all basic data types. Write a Java program to enter two numbers and find their sum. Write a Java program to enter two numbers and perform all arithmetic operations. Write a Java program to enter length and breadth of a rectangle and find its perimeter. Write a Java program to enter length and breadth of a rectangle and find its area. Write a Java program to enter radius of a circle and find its diameter, circumference and area. Write a Java program to enter length in centimeter and convert it into meter and kilometer. Write a Java program to enter temperature in Celsius and convert it into Fahrenheit. Write a Java program to enter temperature in Fahrenheit and convert to Celsius Write a Java program to convert days into years, weeks and days. Write a Java prog

How to find Maximum digit in the given Number|| Find the Max digit in the given number of the user| by prince kumar

How to find Maximum digit in the given Number|| Find the Max digit in the given number of the user| by prince kumar //1.Find the Maximun digit in this given number, Take the one number from the user // and find the mximum digit of this number   import java.util.Scanner; class FindMaxNumber{      public static void main(String args[]){     Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int rem=0; int max=-65537; while(n!=0){        rem=n%10;         if(max<rem) max=rem;         n=n/10; } System.out.println("Maximum digit is:"+max);    } } //========================================================== /*//1.Find the Maximun digit in this given number, Take the one number from the user // and find the mximum digit of this number */ import java.util.Scanner; class FindMaxNumber{      public static void main(String args[]){     Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int rem=0; int min=65537; while(n!=0){        rem=n%10;         if(min

Swap Two Number 5 Way ||How to swap two digit in 5 way|| Er prince kumar ojha|| Swap the number

Swap Two Number 5 Way ||How to swap two digit in 5 way|| Er prince kumar ojha|| Swap the number =================================== 1.Write a Java program to swap two numbers using bitwise operator. package BasicQuestionInJava; import java.util.Scanner; public class SwapeTwoNumber { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.print("Enter First No:"); int a=sc.nextInt(); System.out.print("Enter Second No:"); int b=sc.nextInt(); //Swape the two number using temporary variable int temp=a; a=b; b=temp; System.out.print(" First No:"+a); System.out.print("\nSecond No:"+b); } } /*Output is: Enter First No:10 Enter Second No:20  First No:20 Second No:10 */ ================================================================ 2.package BasicQuestionInJava; import java.util.Scanner; public class SwapeTwoNumber

How to Store 10 or Multiple Records in database of Student class || java language

How to Store 10 or Multiple Records in the database of Student class || java language.

Diamond Pattern Printing ||shape to star using to print the Diamond

Diamond Pattern Printing ||shape to star using to print the Diamond || by Er prince Kumar class Diamond  { public static void main(String[] args){ int n=5; for(int i=0;i<n;i++){ for(int s=0;s<n-i;s++) System.out.print(" "); for(int j=0;j<=i;j++) System.out.print("*"+" "); System.out.println();     }       for(int i=0;i<n;i++){ for(int s=0;s<=i;s++) System.out.print(" "); for(int j=n-1;j>i;j--) System.out.print(" *"); System.out.println();    }   } }

Pyramid Pattern printing in java language|| Pattern printing in interview question|| by er prince kumar

            Pyramid  Pattern printing in java language Java  Program to  Print  Star  Pyramid  Patterns.  Java  Program - Pattern 2. public class JavaProgram { public static void main(String args[]) { int i, j, k=1; for(i=0; i<5; i++) { for(j=0; j<k; j++) { System.out. print ("* "); } k = k + 2; System.out.println(); } } }  Java  Program - Pattern 3.  Java  Program - Pattern 4.  Java  .. ============================================== import java.util.Scanner; class Parimid  { public static void main(String[] args)  { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0;i<n;i++){               for(int j=0;j<n*3-i;j++){                    System.out.print(" ");    }                               for(int j=0;j<=i;j++){                    System.out.print("* ");    }            System.out.println(); } } } ===================================================================

Binary Search program in java || Explain with logic in simple way|| by Er prince kumar ojha

Binary Search Program in  java || Explain with logic in simple way|| by Er prince Kumar Ojha 1. Write a program to find the binary search Method:1 class BinaryS  { public static void main(String[] args)  { int arr[]={2,3,4,5,6,7,8}; int search=5; int first=0; int last=arr.length-1;         int mid=(first+last)/2;     while(first<=last){                 if(arr[mid]<search){                first=mid+1;   } else if(arr[mid]==search){                 System.out.println("Number is found:"+mid);                  break; } else{           last=mid-1; }          mid=(first+last)/2;         }   if(first>last)System.out.println("Number is not found:"); } } ================================== 6.Write a program to implement of Binary search   Method 1:      import java.util.Scanner; import java.util.Arrays; class Binary{ //Binary S