C Program to Find Prime Number
Vložit
- čas přidán 5. 09. 2024
- C Program to Check Whether a Number is Prime or not (Primality Test). This video will help you understand various methods of finding the primality of a given number
This video is a part of this C Programming Practice Programs Playlist: • C Language Practice Pr...
►Checkout my English channel here: / programmingwithharry
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
Thanks a lot for 500k Subscribers. Means a lot!
Should I do Instagram live sometime?
Instagram - instagram.com/codewithharry
Congratulations 🎉
Pls Pls do live on IG will love it
Yes sir we all are waiting
Yes sir please do it
Congratulations sir ji ....and please come live on Instagram ♥️
Harry bhaiya, in the for loop i*i
exactly
Yess
It will get error .eg if n=49
It will check from 2 to 6 and becomes prime but its composite.
Therefore code should be :
for (int i=2;i*i
yes, actually. I too tried this.. thanks, man. it helped me rectifying and correcting my mistake
yeah i just found out
but i got
It is also showing 4 as prime no. This is also an error in that question.
Therefore
but , when we give 4 as input it is giving as prime number so i think in for loop we need to put i*i
True!
Brother tooo much complexed video. Try to make it short and to the point, very disappointed.
Thanks for this video.
All you have to do to test whether a number is prime or not is to divide it successively by all numbers from 2 to n/2, not n. If the remainder of any of these divisions is zero, the number is not a prime. If none of the remainders results in 0, it’s a prime number. Hope it's clear.
it helped
if number is 2 then its modulus will be 0. then it should show not prime. but 2 is prime number
@ramanshukla8498 No it would be a prime number as the loop will only run if (i*i)
can you make the video on software engineer/ agile development plzzzz you explain good ❤️❤️❤️❤️
you can learn from gate smashers
7 th comment ...
Aap ke es student ka......
(You are the best forever )...
You are my gurudev..😍😍😍😍😍❤️❤️❤️❤️❤️❤️
5 lakh Congratulations Harry Bhai..❤️💯....Please Ab tak ki journey pe Ek Video Banta hai...Us Video se hume Bohot Inspiration Milegi❤️❤️❤️
Jald hi sir aapka Chanel 1m pe aa jaayengi....Avi underrated Chanel hai ye bahut
Aapke videos dekh kar hi time complexity ki importance pata chali hai. Pure graduation aur post graduation me teachers ka time complexity padane ka motive ek hi tha ki, examiner ke samne zalil na hona pade.
Hi Harry, I think there is a bug in this program. I checked this code for the number 4 and it says it is prime. In the for loop, the condition should be changed to i * i
yes, I too checked and then corrected my mistake and wrote...i*i
yess
What happen if we do I think it will resolve the problem i*i
Google ka copy paste program hh iska practical program sourab Shukla ka acha hh
Thanks bro, I was looking for this solution in comments 😄
okay..ye smjh me aa gya root n wala concept ..!
yaah u r absolutely correct 😋
Best explanation on prime numbers💯💯
You teaches us a lot Harry bhaiya. Thank you for everything.
You are superb. Congrats for half million subscribers.
question - Who is the best tutor in youtube ?
answer - 1) code with harry 2)Gfx mentor
Who is GFx mentor
still don't know😂😂😂😂
Thank you Sir. Your efforts are very high I am sure that if any one follow this series will definitely love to learn C
Harry bhai kamal ho yaar bhagwan apko lambi umar,seht ,tandursti de or puri life apki khushiyo se bhari rhe jeevan me apko bhut safalta mile esi me kamna karta hun ap jo kr rhe ho bas krte ho ak na ak din ap bhut age jaoge ...thank you so much bro apke duara koi kuch kr jayega kuch ban jayega ....
Congratulations for 500k!
Thanku
Congratulations for 5 lakh subscribers🔥🔥🔥🔥!!!!!
Congratulations!!!! For 500k subscribers!!!! AB TO PARTY BANTI HAI BOSSS!!!!!😆😆
Harry Bhai Answer Please Brother
Bro Please Make A Video On Competitive Programing How To Start And Can I Use Python For Competitive Programing
Or Like People Say choose C++ so can i use c++ only for Competitive coding and python for Devlopment
Pleass answer kroo
I know both saare comments hai but ans kro ✌️✌️✌️✌️✌️✌️
Love you brother and thanks for giving free education
Congratulations for 500k subscribers sir 😍❤️
Bhai data structure implementation ki alag playlist bano
You r such a nice human...
You added everyone's mention to your story..
May God bless u always and you bless us with your amazing content
KEEP Doing Bro . Congrats on 500k
Bhaiya mind blowing concept hai....
The efforts you put into your work are genuinely appreciative 🙌 Learning programming had never been so easy before 😇Thanks alot🥰
Itne easy concept ko apne ,itna hardest kar diya ,ki ab data structure bhi easy lag raha hai ,iske aage
Harry bhai thanks for this course, this course really help me
Those who agree hit the like button
Thanks a lot Harry ... Good explanation for a beginner to understand the concept.
thank you bhai , you have solved my problem of coding
I think adding a break statement inside if block would increase the time complexity and it would make the code more optimal
yeah
Good explanation
Thanks a lot sir🙏🙏 plz try to make video on program of armstrong number
Sir, you tried your best to taught this program and it is understandable.
Mind blowing 😊
@codewithharry , do you have knowledge of Object*(objectstar)
Sir it was a bit complicated but.. by the end of the vedio the program was clear. Thank you sir😊
Sir congratulations 1/2 million.... 1 million soon........
Sir, yahan for loop me condition me i*i
exactly
import java.util.*;
class prime
{
public static void main(String args [])
{
Scanner ob=new Scanner(System.in);
int n =ob.nextInt();
int count =0;
int i;
for(i=1;i
Thanks Harry Bhaiya
Nice explanation bhaiya....
Get your logic is very convenient 👍👍
For better time optimization I think u can just break the loop once isPrime becomes 0.
yes
#include
int main()
{
int n;
printf("enter number : ");
scanf("%d", &n);
if (n >= 0)
{
for (int i = 2; i < n; i++)
{
if (n == 2)
{
break;
}
if (n % i == 0)
{
printf("not ");
break;
}
}
}
printf("prime");
return 0;
}
Harry bhai I've watched your each and every video
Great video harry bhaii..full explanation given thankyouu so much
Request : Python OpenCV Module course
very smart way to test prime divisibiltiy , impressive !
Maza aya bhadiya best explained 👏
Brother, aap aur aap k videos awsmmm..... 👏👏a big thumpsup 🖒🖒
Congrats for half million 👍👌
Sir suru se coading sikhaye na PLZZ sir
Sir I am 18, I am learning Python (with your vedios) but ,please will u explain what up next I have to learn
Thanks for learning such a easy way.
congratulation for 500k subscribers
Congrats 500k...awesome bro..
Keep it up..please make a video on how to add google ad on blog and wordpress website..plszzz
Congratulations on hitting 500K
Thank you Harry sir🙏🙏
Bro
I tried some different method to know whether it is prime or not
#include
void main()
{
int n,i,m=0;
printf("enter the number n ");
scanf("%d",&n);
for(i=1;i
0:46 OneNote Mast hai Harry bhai
Congregation. I AM From Bangladesh
This is so much easier in python
o bhaii har language ka na koi na koi funstion hota hai nahi to aise hi nahi parae hai
@@Anixmusics brother sorry but i don't truly understand ur hindi.....but as far as i can tell that u r trying to say that for everything there is a function in all languages..........but brother i can easily make this or any other program without the use of a function or module 😉
@@mohanraina2036 in which you in ???
@@Anixmusics 12th
@@mohanraina2036 are you Indian or foreigner
Can someone tell in this -> if condition why we didn't wrote (isPrime==1)
if(isPrime){
printf("The number %d is a prime number
", num);
}
else{
printf("The number %d is not a prime number
", num);
}
Sir ap bhut shandar pdhate ho 😍😍😍😍😍
congrats harry bhai for 5 lakh subscribe.
All clear 🙂 thankyou sir
23:08 min mai ek dam shi baat kahi h
Harry many video's are available for C programming......plz start video's series on Azure
20:22 understood
Please make a C++ SFML tutorial please 🙏🤗🤗
Agr koi no. Jo underrood m h or uska is trike s ans n aye jese abhi btaya h to kya krenge sir??
Sir python handwritten notes banado please
In One note your pencil dot is too small it creates confusion where are you pointing.... Do something for it pleaseee 😐😁... No shikayat in your teaching.... Thanks for this good teaching 😊
Got it bhaiya 2 to root(n)
Thankyou...
20:15 I THINK ROOT N TAKH ISLIYE JANA HAI KYUNKI ATLEAST BAKHI INTEGERS SE NAHI AAAPATA DEMANDED PRODUCT TO JO JAHAN PE EK PERFECT INTEGER MILEGA JO BANATHI HAI EK WOH PRODUCT JO HUM DEKHNA CHAHTEY HAIN KYUN NA USI KO HI ROOT MARK KRKEY TAKH CHLNA.
20:00
Harry Bhai Thoda thoda samjha par time ke sath pura samaj me aa jayega
Can null statement be used in this program for non-prime numbers?
27 minutes video only for 1 program...
Yes I know very well explained..
But.. Why, why so long. 🙄😕
Because I have explained the mathematics underneath it! How to solve in O(n) then O(root n)
@@CodeWithHarry yes sir i know very well explained... But shorter videos will be more beneficial.. Please try to make shot videos..
And I like your videos.. I have learned python with your playlist... And now I am learning web development.
Thanks sir🙏
Very good mouse writing
Mere to pen se bhai nai aate acche writing
But, very good explanation 🙂
Please bring advanced c# course.. i am waiting for months now..
sir Python ka project lau please
Jo ve python ka projects cha te ho to comment and like karo
python k projects unhone upload kre hue h channel pe
but i want more new project in python
@@cyberzentech2929 same 👍😁
@@harshitachaurasia1246 go to w3resources to get more exercises. the one Haris does is basic and some are advances, but the ones on w3recourse range from the beginner level to ultimate
@@anshdholakia714 ya thanks for the info i know this already 😀
thank you harry sir
Sir aap jo bhi notes de rahe hai yadi wo printable format (ebook text format) mai hota to print karwana aur bhi aasan hota ... Yadi aap chahe to hum thora bahut fees bhi de skte hai ... Jo ki ebook banwane mai lgega aapko ....
Harry Bhai ek video Google sites par bana do, google sites aur wordpress me difference, etc.
Harry Bhai there's a MISTAKE in this code. When we give 9, 25 or 49 as an input it still shows that it is PRIME. Can you explain why is this happening?
for (int i =2;i* i
Thanks bro
Sir android development videos bana lo
congrats for 500 k harry bhai
you never disapoint me
Add bahut aane lgi hai bhai beech beech me😔 ,but chlo koi bat ni bhai free me etna achha content provide kra rahe hai👍👍
This code won't tell wheter 2 or 3 is a prime number or not...plz help anyone
You explained prime numbers like we used to learn in class 8
bro when are you bringing JAVA Tutorials?)
Already on the channel
congratulations on 500k
for(int i=2; i*i
Please make course on Statistics and probability
500K Completed