package JavaProgms; public class primeOrNot { public static void main(String[] args) { int num = 5; int count = 0; if (num > 1) { for (int i = 1; i <= num; i++) { if (num % i == 0) count++; } if (count == 2) { System.out.println("Prime Number"); } else { System.out.println("Non-Prime Number"); } } } }
@tanayhalder63402 ай бұрын
this program will not work for 9 also dlt this fake vid
@trongtue83842 ай бұрын
What about association ( does it have any different in code systax compare to Aggregation ? )
@aviligondarakesh44773 ай бұрын
Bro this is fully wrong bro
@SiriSreeTechTutorials3 ай бұрын
I’m not sure why this program does not work for you guys.
@aviligondarakesh44773 ай бұрын
@@SiriSreeTechTutorials actuqlly here whats going is i%j in the condition , 2 will be looping here , but not work on 3 and 5 and 4 thats the problem
@nxplusgaming35834 ай бұрын
Bro 9 is not prime but this programme is give output as prime It's just printing even and odd
@SiriSreeTechTutorials3 ай бұрын
I’m not sure why you guys get such wrong output. For me it is working fine. Please do double check the program
@nxplusgaming35833 ай бұрын
@@SiriSreeTechTutorials no bro program is right i was wrong sorry 😔
@vishaljadhav465224 күн бұрын
package JavaProgms; public class primeOrNot { public static void main(String[] args) { int num = 5; int count = 0; if(num > 1) { for(int i = 1; i <=num; i++) { if(num % i == 0) count++; } if(count == 2) { System.out.println("Prime Number"); } else { System.out.println("Non-Prime Number"); } } } }
@user-xk2zb6cv8y4 ай бұрын
Then what about composition
@SiriSreeTechTutorials3 ай бұрын
When an object can not exist without another object, we call that relation as consumption
@HansiRawat-eq8qt4 ай бұрын
Thanks a lot for detailed videos and shorts are superb
@SiriSreeTechTutorials3 ай бұрын
You’re welcome
@chin2vk2146 ай бұрын
This is a fake one if we give some odd multiple it won’t work. For example 33
@SiriSreeTechTutorials6 ай бұрын
No words broo. I don’t know whether you tried or not. Please try once and make a comment
Hi bro. I don’t know Hindi. Not getting what exactly you are looking for.
@UncleJiGaming.6 ай бұрын
Kal Mera project hai iska mujhe iske screenshot chahiye plz
@UncleJiGaming.6 ай бұрын
Plz apne insta I'd do kuch help chahiye aapki
@SiriSreeTechTutorials6 ай бұрын
srikanthpelluru
@UncleJiGaming.6 ай бұрын
Hlo😊
@UncleJiGaming.6 ай бұрын
Plz reply me now
@UncleJiGaming.6 ай бұрын
Bro i need your help
@SiriSreeTechTutorials6 ай бұрын
Yes Bro, tell me
@UncleJiGaming.6 ай бұрын
Hlo
@praneethrichie6 ай бұрын
😂😂😂
@SiriSreeTechTutorials6 ай бұрын
🤣
@Silent-Ghost-Rider6 ай бұрын
You presented my life story in 10 seconds😂❤
@SiriSreeTechTutorials6 ай бұрын
Haha 😛
@pradhyudh6 ай бұрын
As someone who never read documentation,this hits hard
@SiriSreeTechTutorials6 ай бұрын
Then they will read the documentation 😀
@NanthakumarRbca6 ай бұрын
Sir i have a one doubt, MNC companys are like zoho, tcs , will they asked like this questions in selection process ? Sir
@SiriSreeTechTutorials6 ай бұрын
In MNC companies, they might not ask, but if company looking for strong technical person, then there is a chance of asking this type of questions..
@puttapallisatishyadav2226 ай бұрын
bro pls try the exact code in online gdb once!
@SiriSreeTechTutorials6 ай бұрын
Ok I will try
@SiriSreeTechTutorials6 ай бұрын
I tried and, it is working as expected bro.. One thing also observed, if your giving small and capital letters combination, then there is a chance it will get fail. Tell me what input your giving.. so I can analyse and give you solution.
@ninopino127 ай бұрын
This was quixk and informatove, thanks❤
@SiriSreeTechTutorials6 ай бұрын
Glad it was helpful!
@himanshulowanshi51217 ай бұрын
This program is even odd numbers
@SiriSreeTechTutorials7 ай бұрын
If it is even odd number program, I would have written (num%2==0) condition, why we need for loop before this condition. And then I am verifying (num%i == 0) That makes this program as prime or not
@omhatgaonkar27557 ай бұрын
But if we put 1 it says it is prime, and 1 is not prime number
@SiriSreeTechTutorials7 ай бұрын
Yeah. Before for loop, we should write an if condition. Thanks for finding this.
@richardvivin70067 ай бұрын
Really useful Need more problem solving in Java sir
@SiriSreeTechTutorials7 ай бұрын
Sure give me some questions or I will upload after few days.
@richardvivin70067 ай бұрын
@@SiriSreeTechTutorials is sample program enough sir to select in technical interview if yes please do that sir it will be more useful
@SiriSreeTechTutorials7 ай бұрын
Sure, if ur a fresher, you can go through the 100 interview questions that will help you to clear technical. These questions are available in our channel
@nileshgurung94377 ай бұрын
What if we put 2
@SiriSreeTechTutorials7 ай бұрын
Then this will get fail… I notice that and expect the question from followers. Before if, we should check the value is greter than 2 or not, if not then print as not prime and return..
@nikhilagrawal92177 ай бұрын
Thank you for this video.
@SiriSreeTechTutorials6 ай бұрын
Glad it was helpful!
@assasinator46868 ай бұрын
Tq❤❤
@SiriSreeTechTutorials6 ай бұрын
:)
@Dwtech70729 ай бұрын
Good .. I like way you represent 👍
@SiriSreeTechTutorials9 ай бұрын
Thank you so much 😀
@sireeshachennuru887010 ай бұрын
Main1
@SiriSreeTechTutorials6 ай бұрын
:)
@SiriSreeTechTutorials10 ай бұрын
Output: "Main1"
@SiriSreeTechTutorials10 ай бұрын
full video: kzbin.info/www/bejne/p2S5p4OMhNaDiZosi=wzPBJoKoIClWTL9N
Not really bro. First y assigned as x. So y will have 10. Next y is incremented by 1, so y value is 11. Next printing y. So it prints 11. Next we are post incrementing y. So, for that statement y value still 11. Once that statement completed, then y value become 12. But for printing it will use before incremented value. So output will be 11 11
@mblueberry427911 ай бұрын
Cool
@SiriSreeTechTutorials11 ай бұрын
😊
@soum_pray11 ай бұрын
Thats relatable
@SiriSreeTechTutorials11 ай бұрын
😹
@SiriSreeTechTutorials11 ай бұрын
Full Video kzbin.info/www/bejne/mmOphXugqsmKqas
@naveenwatare29511 ай бұрын
Good and short explanation keep going 👏👏
@SiriSreeTechTutorials11 ай бұрын
Thank you 😊
@lec025shobanaselvaraj511 ай бұрын
What's the output!??
@SiriSreeTechTutorials11 ай бұрын
It will be a compilation error. It is a method, that should return Constructor class object. But in the method, there is no return statement.