22 - PROGRAM TO FIND THE PRIME NUMBERS IN GIVEN RANGE - C PROGRAMMING

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024
  • C Program to find all prime numbers in between the given range.
    Prime number is a number which is having only two factors 1 and itself.

ความคิดเห็น • 130

  • @thebudkellyfiles
    @thebudkellyfiles 6 ปีที่แล้ว +18

    Been working on this and this vid helped me get it. You always come through. Thanks!

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      Thank you for following my sessions.

    • @binayakpurohit
      @binayakpurohit 4 ปีที่แล้ว +4

      Second loop should be j

    • @NSamuel10000
      @NSamuel10000 2 ปีที่แล้ว

      Why loop j ALWAYS start for 1 each iteration

    • @NSamuel10000
      @NSamuel10000 2 ปีที่แล้ว

      Explain to me please !help me!

    • @NSamuel10000
      @NSamuel10000 2 ปีที่แล้ว

      I am confused

  • @t.dileepak4296
    @t.dileepak4296 5 ปีที่แล้ว +6

    All credits go to you sir. Now I undetstood how the logic works. Thank you very much sir

  • @ashuashwini2035
    @ashuashwini2035 4 ปีที่แล้ว +7

    That's not j

    • @amarjeetbhatia6508
      @amarjeetbhatia6508 4 ปีที่แล้ว

      That's already shown in video man

    • @gkguru6830
      @gkguru6830 4 ปีที่แล้ว +1

      yes sir initially mentioned is exactly correct. j

    • @kalyanachakravarthi2736
      @kalyanachakravarthi2736 3 ปีที่แล้ว

      @@gkguru6830 we need include 'i' too in the body function, that's why we need to include only one closing bracket after count++, am I right?

  • @martinsin9775
    @martinsin9775 4 ปีที่แล้ว +2

    Great! Tones of detail!! Super!!

  • @Harshitha-hi1uj
    @Harshitha-hi1uj ปีที่แล้ว

    Your teaching is so good sir. I thank you so much for teaching so well. Please make many more videos sir, that helps a lot.

  • @aiswarya3461
    @aiswarya3461 6 ปีที่แล้ว +7

    Thank You Sir for kindling the interest in me towards programming !!!

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +3

      Hi aiswarya
      Thanks for your interest towards our channel and share my sessions with your friends and keep following our channel and don't forget to subscribe to our channel.

  • @pindisrinivas1157
    @pindisrinivas1157 2 ปีที่แล้ว +1

    thank you so much sir,we want more examples expecting from you sir....thanks for your dedication ..😍

  • @volkangundogdu1008
    @volkangundogdu1008 4 ปีที่แล้ว +1

    super sweat and dedicated way of teaching !

  • @krishnareddykrishnareddy3076
    @krishnareddykrishnareddy3076 6 ปีที่แล้ว +2

    Thank you sir
    Continue sir... Your explanation is very good 👌👌👌👌

  • @bimalmurali2781
    @bimalmurali2781 4 ปีที่แล้ว

    Very helpful. Explained to the deep of the program...

  • @You-ec2pi
    @You-ec2pi ปีที่แล้ว

    Thankyou so much sir, you are the best.I like the way you are teaching it"s help us a lot.
    Can you please make the video on github.....please sir

  • @yeddulalokesh7500
    @yeddulalokesh7500 2 ปีที่แล้ว

    Thank you So much , it is helpful for me.

  • @vishakhasharma9385
    @vishakhasharma9385 6 ปีที่แล้ว +3

    Thanku so much . Such a lucid explanation😊👍

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      hi vishakha
      thanks for your interest towards our channel and share my sessions with your friends and subscribe to our channel.Keep following our channel.

  • @dharanisana1483
    @dharanisana1483 5 ปีที่แล้ว

    Thank u so much sir....ur way of explanation is crystal clear...keep doing videos like this

  • @vinayakpomendkar8948
    @vinayakpomendkar8948 ปีที่แล้ว

    Very helpful sirji please share more videos to us thanks

  • @manojmovieinfo6838
    @manojmovieinfo6838 3 ปีที่แล้ว

    Superr sir simple solution it helps me a lot

  • @siva-vw8us
    @siva-vw8us 6 ปีที่แล้ว +5

    Thank you sir,and you have to explain more programs

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi sivaleela
      thanks for watching my sessions and sure i will do more videos on programs.

  • @akhilkumarbaratam3335
    @akhilkumarbaratam3335 6 ปีที่แล้ว

    tq u so much . Such a lucid explanation

  • @prashanthagurla3376
    @prashanthagurla3376 3 ปีที่แล้ว

    In j loop j

  • @arjun9353
    @arjun9353 4 ปีที่แล้ว

    Thanks alot sir......hope further videos in future would be usefull
    ..

  • @701jyothiswaruban7
    @701jyothiswaruban7 3 ปีที่แล้ว

    superb explanation, thanks sir

  • @chipora3678
    @chipora3678 2 ปีที่แล้ว

    int flag = 0; should be declared inside first for loop to get the output as shown in above example!

  • @dhruvsy7370
    @dhruvsy7370 5 ปีที่แล้ว

    Thank you sir for this video
    Plzz make such more

  • @Atharhashmisir
    @Atharhashmisir 4 ปีที่แล้ว +2

    यदि आपको हिंदी में सीखना हो, तो मेरे चैनल पर ज़रूर देखे।

  • @aniketpandey2007
    @aniketpandey2007 5 ปีที่แล้ว

    Although this problem can be solved in lesser space complexity, I must remark very well explained sir!!

  • @jasdeepkaur1781
    @jasdeepkaur1781 4 ปีที่แล้ว +3

    Hey!!!
    Can uh please explain it by using function 🙄🙄

  • @brundashekar8460
    @brundashekar8460 6 ปีที่แล้ว +1

    Nice explanation sir

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      Hi brunda
      Thanks for your interest towards our channel and share my sessions with your friends and keep following our channel and don't forget to subscribe to our channel.

  • @sanjaybliospartan2317
    @sanjaybliospartan2317 5 ปีที่แล้ว

    Awesome!!!

  • @ritintiwari9788
    @ritintiwari9788 4 ปีที่แล้ว +2

    Hii sir
    I don't understand the flag=0 as i am watching your video since starting and is not discussed in any video so its a humble request to make video on this and i don't understand the output 1%1=0 so value flag=0 so please clarify this dout

  • @sangeeth810
    @sangeeth810 5 ปีที่แล้ว

    Good wayy of teaching

  • @sridharreddy4868
    @sridharreddy4868 3 ปีที่แล้ว

    Sir you are explaining is very good but what you are explianed program just compile it sir once

  • @Nithin_1367
    @Nithin_1367 2 ปีที่แล้ว

    Why we are taking flag=0 in inner for loop.

  • @fashion2508
    @fashion2508 5 ปีที่แล้ว +1

    nice explanations

    • @sundeepsaradhi
      @sundeepsaradhi  5 ปีที่แล้ว

      Hi
      Thank you for your support towards our channel share our channel with your friends and keep following our channel.

  • @editionpick7717
    @editionpick7717 2 ปีที่แล้ว

    Sir there is mistake ...we can't initialize the flag value in int main ....the program will not executed....we have to initialize like that
    Int i,j,Flag;
    for(i=1;i

    • @editionpick7717
      @editionpick7717 2 ปีที่แล้ว

      So sir please make video with execution of program in computer

    • @ELInventors
      @ELInventors 2 ปีที่แล้ว

      Thanks mahn

  • @bijayalaxmipatra2974
    @bijayalaxmipatra2974 2 ปีที่แล้ว

    Sir jayganath,,, sir you have to put in inner loop j

  • @Butterfly-oy5tr
    @Butterfly-oy5tr 3 ปีที่แล้ว +1

    Sir.. Flag is a just variable..I'm right.. We can right any name to replace flag

  • @narpathrajpurohit9915
    @narpathrajpurohit9915 6 ปีที่แล้ว +2

    Sir u forget about the prime number intervals

  • @ramyagudivaka4944
    @ramyagudivaka4944 6 ปีที่แล้ว +1

    In the given series 1,2,1,3,2,5,3,7,5,11,8,13.......odd terms form fibinocci series and Even terms form prime numbers.please tell me the program to generate nth term

  • @ommsairam4181
    @ommsairam4181 ปีที่แล้ว

    🙏🙏🙏🙏🙏❤️❤️❤️❤️❤️

  • @gousiyashaik5665
    @gousiyashaik5665 3 ปีที่แล้ว

    Thank you sir

  • @mohammedakhil10
    @mohammedakhil10 ปีที่แล้ว

    What is flag and what is counter?

  • @chinthasharada570
    @chinthasharada570 3 ปีที่แล้ว

    J‹=i...is the correct

  • @kutumbakavarsha6716
    @kutumbakavarsha6716 6 ปีที่แล้ว

    Thank you very much sir

  • @gandheyadagiri8039
    @gandheyadagiri8039 2 ปีที่แล้ว +1

    sir program is comig error at for statement

  • @ragavipandi9698
    @ragavipandi9698 5 ปีที่แล้ว

    Super Sir😎😎😎

  • @sridhars3204
    @sridhars3204 4 ปีที่แล้ว +1

    Sir, What is meant by flag? Why do we use flag suddenly? could you please explain?

    • @sundeepsaradhi
      @sundeepsaradhi  4 ปีที่แล้ว

      hi
      flag is also a variable nothing new.

  • @virangabandara674
    @virangabandara674 3 ปีที่แล้ว

    Thnq sir 🔥🔥

  • @zoterodisuke4398
    @zoterodisuke4398 3 ปีที่แล้ว

    Please help me explain my code. I am confused at the for loop j because when I put j = 0, 1, 3, 5, I + 1. all these seems to work but I don't understand why it works.
    #include
    #include
    #define MAX 100
    int main()
    {
    int isPrime[MAX];
    int i, j, num;
    printf("Enter a number [more than 2]: ");
    scanf("%d", &num);
    for(i = 0; i < MAX; i++)
    {
    isPrime[i] = 1;
    }
    for(i = 2; i

  • @manmohanpatnaik9557
    @manmohanpatnaik9557 6 ปีที่แล้ว +4

    8.45 j>=i is correct...Not j

  • @anuragyadav8634
    @anuragyadav8634 7 ปีที่แล้ว +3

    sir plz make video on function
    and plz hurry up sir

    • @sundeepsaradhi
      @sundeepsaradhi  7 ปีที่แล้ว +2

      hi anurag
      definitely and before i have to complete strings concept. Immediately after Strings i will upload functions.

    • @anuragyadav8634
      @anuragyadav8634 7 ปีที่แล้ว +1

      Tnq sir your teaching method is very good bu you should upload more video on main of c like as function,array,pointers

    • @sundeepsaradhi
      @sundeepsaradhi  7 ปีที่แล้ว

      hi anurag and thanks for your interest towards our channel and i am uploading videos in an order till now i have covered upto one dimensional arrays and definitely i will upload the remaining soon.

    • @sundeepsaradhi
      @sundeepsaradhi  7 ปีที่แล้ว +1

      This is the link of Functionsth-cam.com/video/TEHA_IwNk34/w-d-xo.html

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi ANURAG
      i would like to have a FEEDBACK ( in the form of video not more than 15 sec) from you towards our channel and my sessions.so that i will collect feedbacks from all and will upload in youtube,
      Send your valuable FEEDBACK to my WhatsApp number : +91 9885466061 (91 is the country code)
      waiting for your valuable feedback.
      th-cam.com/users/sundeepsaradhi
      SO MAKE A VIDEO WITH FEEDBACK ON OUR CHANNEL AND SEND AS SOON AS POSSIBLE

  • @htetwayyanpaing
    @htetwayyanpaing 5 ปีที่แล้ว +2

    Hello Sir.Why Flag need to declare again under for loops.IF don't declare in that place the program doesn't work.I want to know
    Why flag was declare two times.Please.

    • @hanscesa5678
      @hanscesa5678 5 ปีที่แล้ว +1

      Because in the inner loop, once the condition fails, it will go move outside and re-run the outer loop. So, if you did not declare your flag = 0, in the outer loop, then the flag will always contain 1 or 2 because of the inner loop. Just think of it this way: if the inner loop fails, the flag value will return to 0 to start again.

    • @sindhujasindhu6337
      @sindhujasindhu6337 ปีที่แล้ว

      Cab we use count instead of flag?

  • @sanjaynshreenivas1107
    @sanjaynshreenivas1107 6 ปีที่แล้ว +3

    8:10 is 2

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว +1

      hi srinivas
      thanks for observation and i just written the condition wrong at that time j

    • @manmohanpatnaik9557
      @manmohanpatnaik9557 6 ปีที่แล้ว

      Sundeep Saradhi Kanthety here j>=i is correct...

  • @AyanKumarManna
    @AyanKumarManna 6 ปีที่แล้ว

    You don't need to run j upto n.. You need to run j upto sqrt(i).

  • @n.sarath4505
    @n.sarath4505 2 ปีที่แล้ว

    How add sum of the prime Numbers?can u tell me sir.

  • @hellwalker8602
    @hellwalker8602 4 ปีที่แล้ว +1

    You won't get the answer if you declare flag =0 outside for loop as you did in your case

  • @Saikumarkusuma123
    @Saikumarkusuma123 5 ปีที่แล้ว +1

    Sir, its not executing
    When i entering the number in result window
    It is getting back to the program

  • @prasannaganesh2996
    @prasannaganesh2996 6 ปีที่แล้ว +1

    For what we use flag

  • @le-310harikrishna4
    @le-310harikrishna4 2 ปีที่แล้ว

    What is flag sir

  • @aarulive3213
    @aarulive3213 2 ปีที่แล้ว

    How to find largest 9 digit prime number in c program

  • @SaiKiran-uu8ov
    @SaiKiran-uu8ov 3 ปีที่แล้ว

    why we take flag== 2 only

  • @thecodinghubpoint6364
    @thecodinghubpoint6364 3 ปีที่แล้ว

    write a program in c language user input the value (Hello) or output is (H*l*o).

  • @gangadhargangadhar1381
    @gangadhargangadhar1381 2 ปีที่แล้ว

    Didn't understand clear ga cheppandhi

  • @slientpower_3661
    @slientpower_3661 5 ปีที่แล้ว +1

    Sorry to ask 1 also prime no

    • @sreelathas585
      @sreelathas585 4 ปีที่แล้ว

      1 is not a prime number because it has only one factor prime number must have two factors

  • @vinothvaradharajan3063
    @vinothvaradharajan3063 2 ปีที่แล้ว

    What is flag

  • @devivaraprasad1507
    @devivaraprasad1507 3 ปีที่แล้ว

    sir what if we want know given number is a prime number ??

  • @bizay1982
    @bizay1982 6 ปีที่แล้ว +2

    Sir what is the use of flag=o

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi
      its just like a variable and the name i have given as flag.
      thanks for your interest towards our channel and share my sessions with
      your friends and subscribe to our channel.Keep following our channel.

    • @byrrajuabhilashraju1822
      @byrrajuabhilashraju1822 5 ปีที่แล้ว

      Same as count bro it aslo just counts the values

    • @pavithradevia6527
      @pavithradevia6527 5 ปีที่แล้ว

      Flag is used to differentiate prime and non prime number

  • @goplay5936
    @goplay5936 5 ปีที่แล้ว

    How to count prime numbers in 2d array?

  • @satyadodda2386
    @satyadodda2386 6 ปีที่แล้ว +1

    sir plzzzz make a video on a program to check whether it is a palindrome or not using functions plzzzz sir

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi satya
      definitely i will try to upload the program soon with in two or three days.

  • @chocoojay7479
    @chocoojay7479 3 ปีที่แล้ว

    What is flag variable sir?

  • @dancewithfingers8687
    @dancewithfingers8687 3 ปีที่แล้ว

    Im still not getting purpose of count

  • @vinodvinny1309
    @vinodvinny1309 3 ปีที่แล้ว

    How to count number of prime numbers? Sir

  • @joseamithsebastian9494
    @joseamithsebastian9494 3 ปีที่แล้ว

    my program didnt run all numbers are coming not prime

  • @rojnamcha179
    @rojnamcha179 6 ปีที่แล้ว +1

    Sir plz c assignment papers solved kar dijiye na....

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi piyali roy
      post your doubts in the comment section so that i will clarify your doubts.

  • @vinobavino9509
    @vinobavino9509 ปีที่แล้ว

    Sir can we use count instead of flag?

  • @saineeraj1326
    @saineeraj1326 3 ปีที่แล้ว

    I can't understand this can u explain the program in telugu

  • @HamsterKombat0502
    @HamsterKombat0502 5 ปีที่แล้ว

    I think j%i is correct instead of j%n

  • @ramyagudivaka4944
    @ramyagudivaka4944 6 ปีที่แล้ว

    Sir please give the program to generate nth term of a prime number

  • @ananthreddy1677
    @ananthreddy1677 3 ปีที่แล้ว

    ouput not getting sir

  • @sanjayshelke8751
    @sanjayshelke8751 4 ปีที่แล้ว

    For 1 flag is one and not work

  • @sanjanagurav1830
    @sanjanagurav1830 6 ปีที่แล้ว

    Thanks sir .

  • @tejasgadekar7214
    @tejasgadekar7214 6 ปีที่แล้ว +2

    You forgot else part

    • @sundeepsaradhi
      @sundeepsaradhi  6 ปีที่แล้ว

      hi teja
      i think there is no use of else part in this program because here our problem statement is only to print all the primes in given range. i forget and written the else part in the program.
      Hope your doubt has been clarified.

    • @gkguru6830
      @gkguru6830 4 ปีที่แล้ว

      program is for series printing , so "simple- if" is enough. If the program is for checking either A or B. You are correct. It require else part too.

  • @sathoshreddy
    @sathoshreddy 3 ปีที่แล้ว

    Sir this vedio is not cler

  • @sksaddam8775
    @sksaddam8775 4 ปีที่แล้ว

    Sir your program is little worng please chek

  • @shrutimanaguli6026
    @shrutimanaguli6026 3 ปีที่แล้ว +1

    Sir sorry I like ur all videos
    Bt this one is bad explanation

  • @raghupatrunishashank7388
    @raghupatrunishashank7388 5 ปีที่แล้ว

    Thank you so much sir