Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
3.36K subscribers
1.13K photos
3 videos
17 files
373 links
Main channel https://t.me/Coding_000
Contact Admin 👉 @ILOVEU_143 for booking your exam slots
Web- https://coding000.github.io/Projects/
💯% clearance in any placement exams
OffCampus -https://t.me/Offcampus_000
Discussion- https://t.me/exams_discussion
Download Telegram
Give reactions guys..and share our channel...to get more solutions...❤️😁
👍7👏1
import java.text.*;
import java.util.*;

public class MonthDirefence {
  public static int getMonthDiffence(String d1, String d2) throws ParseException {
    SimpleDateFormat sdf = new SimpleDateFormat("dd-mm-yyyy");
    Date start = sdf.parse(d1);
    Date end = sdf.parse(d2);
    Calendar startC = new GregorianCalendar();
    startC.setTime(start);
    Calendar endC = new GregorianCalendar();
    endC.setTime(end);

    int diffYear = endC.get(Calendar.YEAR) - startC.get(Calendar.YEAR);
 
    return diffYear;
  }

  public static void main(String[] args) throws ParseException {
    Scanner sc = new Scanner(System.in);
    String d1 = sc.nextLine();
    String d2 = sc.nextLine();
    System.out.println(getMonthDiffence(d1, d2));

  }

}
Documents code
@Coding_000
👍4
int countNecklaces(int maxPearls, int startMagnificence, int endMagnificence) {
    int count = 0;
    for (int pearls = 1; pearls <= maxPearls; pearls++) {
        for (int magnificence = startMagnificence; magnificence <= endMagnificence; magnificence++) {
            if (pearls == 1) {
                count++; // count necklaces with one pearl
            } else {
                int prevCount = count; // remember count before adding necklaces with pearls-1
                for (int prevMagnificence = startMagnificence; prevMagnificence <= magnificence; prevMagnificence++) {
                    count += prevCount; // add count for each magnificence power
                }
            }
        }
    }
    return count;
} charles and necklace
C++👨‍💻
👍3🤔2
Pls give feedback about our work


Join: @Coding_000
contact -@ILOVEU_143❤️

Share my channel with your friends and college groups🥳

Trust us Expect us 👍👍😍
5🔥2👨‍💻1