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
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
No one is sharing my channel 🥺🥺
👍3🔥2
Guys...don`t msg..me..i will send codes here..
pls wait...
pls wait...
👍3🔥1
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++👨💻
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
This media is not supported in your browser
VIEW IN TELEGRAM
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 👍👍😍
Join: @Coding_000✅
contact -@ILOVEU_143❤️
Share my channel with your friends and college groups🥳
Trust us Expect us 👍👍😍
❤5🔥2👨💻1
Social Network Code
All Testcases Passed ✅🥳
All Testcases Passed ✅🥳
Oops concept
Tata steel
Tata steel