C Program to check leap year

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 145

  • @AmanSingh-qc1rk
    @AmanSingh-qc1rk 5 лет назад +5

    First part of video -strong logic
    Loved it & lovely explanation sir

  • @sudarshanmhaisdhune1039
    @sudarshanmhaisdhune1039 3 года назад +7

    Many of us can get program from other resources but for logic do watch full video with full concentration guys....

  • @zianizami8671
    @zianizami8671 7 лет назад +3

    Shukla Saheb namaste.
    I had been banging my head to get some simple way to learn programming but was unsuccessful. Today I came across your clip on how to choose your program and that's exactly what I wanted. The five languages i.e. kotlin and ending on javascript was exactly what I wanted. Everyone was emphasising to select your own but the way you explained you boosted me with great motivation.
    I also went thru your biography and salute you for your down to earth personality. I am already your subscriber and would pay to become premium member.
    I am damn confident I would get all my mind boggling questions answered by you as I am totally new to programming but am determined to make it my passion and career inspite of being quite aged. Wish you best of health and best of luck. Anyone would be happy to have a mentor as you and so am I. Best regards.
    Zia Nizami.

    • @mysirgdotcom
      @mysirgdotcom  7 лет назад +1

      Thanks for your words. Best wishes, enjoy learning

  • @sumanmanhare2574
    @sumanmanhare2574 3 года назад +1

    Very nice explain sir

  • @Hope444-v6q
    @Hope444-v6q 3 года назад +1

    Superb sir

  • @husainabbas4154
    @husainabbas4154 2 года назад

    Aap to mere mazher sir ki tarha padha rahe he totally bounce thanks for confusingly vedio

  • @Gol_D.
    @Gol_D. 2 года назад +1

    Nice sir jii

  • @rajrai4294
    @rajrai4294 6 месяцев назад

    Started Coding journey by Your support ❤❤

  • @mayankk104
    @mayankk104 7 лет назад +1

    good luck for your new c language series

  • @heetdoshi200
    @heetdoshi200 3 года назад +3

    Hello Sir,
    I have Properly understood Logic from your video.
    But sir I would like to tell my logic about leap year Program...
    If Sir We do only if( year %4==0 ) then It is a Leap year else It is a not Leap year.
    Sir tell me if it is wrong.
    Thank you Sir.

    • @husainabbas4154
      @husainabbas4154 2 года назад +1

      Bahi sahi he ye mene bhi ese hi kiya he

    • @hardiktiwari5944
      @hardiktiwari5944 2 года назад +1

      Yes u are....
      1700 is non leap year...
      But according to your logic 1700 is a leap year

    • @vaibhavkashyap4727
      @vaibhavkashyap4727 Год назад

      int leapyear;
      printf("Enter year
      ");
      scanf("%d",&leapyear);
      if(leapyear%4==0 && leapyear%100!=0){
      printf("%d is a leap year",leapyear);
      }
      else{
      printf("%d is not a leap year",leapyear);
      }
      yh mene banaya hai ek bar chala k dekho yh

  • @vinodsonkar735
    @vinodsonkar735 7 лет назад +1

    Thanks you sir...
    For doing such a great work...

  • @vikasarya6895
    @vikasarya6895 6 лет назад

    Thanks sir ase sir hona chiye to student ki life ban jaye

  • @sahilshaikh5604
    @sahilshaikh5604 4 года назад +8

    I am totally confused 🙄😒

  • @Jaswantsingh-oe9ub
    @Jaswantsingh-oe9ub 4 года назад +1

    Sir, I have a doubt . If a number is divisible by 400 then it is also divisible by 100 and 4 then why should we write them saperately? We can use 400 only. I learn C language from your video course .

    • @shortvdo69
      @shortvdo69 Год назад

      because to check if it is divisible by 4 or not
      it is nested IF condition bro

  • @deepakborah8335
    @deepakborah8335 7 лет назад +1

    It's really interesting video.

  • @eagleshadow7967
    @eagleshadow7967 2 года назад +1

    Thank you sir

  • @sanjaykumar-gz1zg
    @sanjaykumar-gz1zg 4 года назад +1

    Sir can you tell me
    What software you are using to run c programming. Because I am using turboc++ but i am phasing some problem . So request to you please tell me

  • @Madhav_Thakkar
    @Madhav_Thakkar Месяц назад

    thank you SirG

  • @Rahul-ve6vn
    @Rahul-ve6vn 5 лет назад +3

    Sir par programming tho #include seh start hota hai na par?

    • @sipipradhan6496
      @sipipradhan6496 5 лет назад +1

      Start hota hai mat bolo pehle bolo kiyun start hota.....

    • @Rahul-ve6vn
      @Rahul-ve6vn 5 лет назад +1

      Haa tum bolo na ku hota hai

  • @shahdivya8775
    @shahdivya8775 7 лет назад +2

    Sir give me an answer ..kya hum only 4 se devide karke nahi like sakte.kyoki Jo bhi 4 seedevide hoga vo 400 bhi hoga or 100 sebhi hoga...

    • @mysirgdotcom
      @mysirgdotcom  7 лет назад +8

      4 se kewal divide karoge to 1900 ko bhi leap year bol doge jo ki leap year nahi hai

    • @dhrubajyotiroy3301
      @dhrubajyotiroy3301 5 лет назад

      1700 is evenly divisible by 4 but not divisible by 400 and 1700 is also not a leap year . so we have to check that whether a number is divisible by 400 or not

    • @adarshranjan3090
      @adarshranjan3090 5 лет назад

      @@dhrubajyotiroy3301bro, i wanna learn c concepts from u, 👉👉👉👉👉 Add me as a contact on RUclips. ruclips.net/user/add_contact?c=dqniClnW7-ZTMunba1Bn-TjRcm-GUw

  • @dhrubajyotiroy3301
    @dhrubajyotiroy3301 5 лет назад +14

    sir ,your videos really clear the concepts
    anyone can do this way also ,just need to know the use of logical AND and logical OR operators. makes it more efficient
    int yr;
    if(yr%400==0||(yr%100!=0&&yr%4==0))
    printf("it is a leap year");
    else
    printf("The year entered is not a leap year");

    • @loftybits6301
      @loftybits6301 5 лет назад +4

      but, we dont need to check with 100. it can also be correct. if(year%4==0||year%400==0)

    • @rahuldeo9563
      @rahuldeo9563 3 года назад

      1900wrong method

    • @pankajpanday6351
      @pankajpanday6351 3 года назад +3

      @@loftybits6301 NO you can't do this......it will give incorrect result for e.g. 1700 is divisible by 4 but it is not a leap year

  • @nehalal3110
    @nehalal3110 5 лет назад

    Sir what if in first else if instead of 100 I'll write 400 and then print not a leap year and then instead of taking second else if we just write else and print leap year.
    Will it work

  • @c8cAryan
    @c8cAryan 7 лет назад +5

    10th 50%
    12th 46.6
    BCA 67.6
    Can i eligible all University mca exam
    Because my 12th marks less than

  • @Rahul_creations6
    @Rahul_creations6 6 лет назад +1

    Sir Thanks for you 2nd show programming in C

  • @bhavinlathiya6935
    @bhavinlathiya6935 4 года назад

    sir,you said a number is divisible by 100 is also divisible by 4.but is not true for ex when i tech 1700.this number is divisible by 100 but not 4.

  • @Patel_jishan
    @Patel_jishan 7 месяцев назад

    thanks!!
    new logic added in my knowledge:y%4

  • @sadhanapatel8204
    @sadhanapatel8204 3 года назад

    Sir kya mai program to print list of leap year from 2001to2021ke liye ye jo aap bta rhe h vo likh sakte h kya

  • @onkarta5300
    @onkarta5300 5 лет назад

    10:08 wo else condition me vaha par agar hamne %4 ki place par %400 le liya to chalega?

  • @ekansh6267
    @ekansh6267 2 года назад +1

    👌🔥

  • @mohammadfaizchhipa3374
    @mohammadfaizchhipa3374 7 лет назад

    main()
    {
    Int year;
    Printf("Enter a year" ) ;
    Scanf ("%d", & year) ;
    If(year%4||year%400)
    Printf("
    %d is not a leap year",
    year)
    else
    Printf("%d is leap year ", year) ;
    }
    Sir, is it write in every case or nor, please reply

    • @dhrubajyotiroy3301
      @dhrubajyotiroy3301 5 лет назад

      you can"t use logical OR operator in if condition here because some numbers which are divisible by 4 may not be divisible by 400 like 1700

    • @ritavyas644
      @ritavyas644 4 года назад

      @@dhrubajyotiroy3301 That's what he is trying to make. Year should be divisible by 4 or 400.

    • @okthanks1643
      @okthanks1643 2 года назад

      @@ritavyas644 the problem is that in if else there is short circuit mtlb yeh ki agar pehla condition true hogya toh dusra check hiin nahi hoga

  • @tusharm.8161
    @tusharm.8161 7 лет назад

    Great video

  • @pankajmehta5226
    @pankajmehta5226 7 лет назад

    Video Achha lga sir

  • @ADITYA-rl8ub
    @ADITYA-rl8ub 7 лет назад +1

    sirji nice video

  • @mohammadaadil964
    @mohammadaadil964 6 лет назад +1

    Sir kya aap bata sakte he ki years ko 4 SE hi divide kyu karte he.please reply sir

  • @Wadielolab
    @Wadielolab 7 лет назад

    Thank you sir. Sir ask one question in previous vedio but u didn't answer about that

  • @swarnavachatterjee7475
    @swarnavachatterjee7475 7 лет назад

    sir, you teach difficult things in the most simplest way!!

  • @nvision.studywithfun872
    @nvision.studywithfun872 7 лет назад

    Sir is video me ham century year aur leap year dono ko ek sath dekh rahe right?

  • @rameshakhila6802
    @rameshakhila6802 7 лет назад

    good explanation sir

  • @AdityaThakur05
    @AdityaThakur05 2 года назад +1

    Is this correct plz reply?
    Void main()
    {
    int year;
    printf("Enter The Year
    ");
    Scanf("%d",&year);
    if(year % 400==0 || year % 100 == 0 || year %4 =0)
    {
    printf("The year is leap
    ");
    }
    else
    {
    printf("The year is not leap");
    }
    }

    • @vaibhavkashyap4727
      @vaibhavkashyap4727 Год назад

      int leapyear;
      printf("Enter year
      ");
      scanf("%d",&leapyear);
      if(leapyear%4==0 && leapyear%100!=0){
      printf("%d is a leap year",leapyear);
      }
      else{
      printf("%d is not a leap year",leapyear);
      }
      aapne jo banaya hai usme 100 se divide ho rha hai mtbl ki century year bhi leap year mane jainge

  • @saveearth5688
    @saveearth5688 7 лет назад

    Sir please make video lectures on "Pointers"

  • @pixelated-loser
    @pixelated-loser 7 лет назад

    Sir please answer
    Can we write this code like that
    main()
    {
    int year;
    clrscr();
    printf("Enter a number : ");
    scanf("%d",&year);
    if( year%4 && year%400)
    printf("Not a Leap year");
    else
    printf("
    Leap year");
    getch();
    }

    • @nvision.studywithfun872
      @nvision.studywithfun872 7 лет назад

      Yes u can but remember in if block u r using && operator means if first condition is false means its result is 0 then it never check next condition
      So be careful

    • @nvision.studywithfun872
      @nvision.studywithfun872 7 лет назад

      Sorry friend this time I'm anable to tell u because this time I have no laptop
      I will tell u tommarow
      Good night

    • @nvision.studywithfun872
      @nvision.studywithfun872 7 лет назад

      Abhijeet Singh I am understanding
      But you think a second that in && operator condition is false then its return 0 and as you know that if first condition is false in || operator then second condition never checked

  • @bibinbabu5742
    @bibinbabu5742 6 лет назад

    sir i hav a request i tried to build simple php cart in core php..but i could't make it..your teaching i understand easly so please please upload simple php cart tutorial..

  • @AVINASHKUMAR-vo3cc
    @AVINASHKUMAR-vo3cc 6 лет назад

    what is the logic behind divided by 100,if we divided directy 400 to cheak leap year or not.Is it necessary to divide by 100,if yes then tell me reason

    • @mysirgdotcom
      @mysirgdotcom  6 лет назад

      yadi 1980 ko 400 se divide karoge to yeh leap year nahi aayega, jabki yeh leap year hai

    • @AVINASHKUMAR-vo3cc
      @AVINASHKUMAR-vo3cc 6 лет назад

      but it is divisible by 4.... in condition we also use (leap%4==0)...now why we divide by 100...

    • @AVINASHKUMAR-vo3cc
      @AVINASHKUMAR-vo3cc 6 лет назад

      we should check by 4&400,to find the leap year ,...why we use 100 to divide .

    • @AVINASHKUMAR-vo3cc
      @AVINASHKUMAR-vo3cc 6 лет назад

      yadi 1980 ko 400 se divide karne pe leap year nahi aaegi to 4 se divide karenge 100 se thode he karnege to 100 q use kia ja raha hai....
      void main(){
      int leap;
      printf("enetr the number");
      scanf("%d",&leap);
      if(leap%400==0)
      printf("leap year ");
      elseif(leap%4==0)
      printf("leap year");
      else
      printf("not leap year");
      }
      is program se leap find kia ja sakta hai.....

    • @adarshranjan3090
      @adarshranjan3090 5 лет назад

      @@AVINASHKUMAR-vo3cc bro, there are many 🤸🤸kid🤼🤼examples u r looking for-- 1700,1900,1300,1500,2100,2200,2300,2500,2700,2600,2900😝😝😝😝😝😝😂😂😂😂😂😂😂😂😂😂😂

  • @nishantsharma8776
    @nishantsharma8776 7 лет назад

    bhut acchi video hai sir

  • @vishalmishra7719
    @vishalmishra7719 7 лет назад +1

    Sir, What is difference between int and long int.???

    • @mysirgdotcom
      @mysirgdotcom  7 лет назад +4

      int variable takes 4 bytes in memory, long int variable takes 8 bytes

    • @vishalmishra7719
      @vishalmishra7719 7 лет назад

      Thanks, What is the use and difference between getc() , and getchar() functions.???

  • @swarnavachatterjee7475
    @swarnavachatterjee7475 7 лет назад

    sir, plzzz reply.. I'm a big fan of yours

  • @ChandanKumar-ge5eh
    @ChandanKumar-ge5eh 6 лет назад

    thank you very much sir.

  • @natashasahoo9757
    @natashasahoo9757 3 года назад

    Thanks sir..its helpful

  • @sundrampandey9815
    @sundrampandey9815 7 лет назад +1

    sir motivation video laiye

  • @prakashjoshi4538
    @prakashjoshi4538 6 лет назад +1

    Nice....

  • @azadmhd
    @azadmhd 7 лет назад

    Thanks sir plz create operating system tutorial

  • @AKASHDEEP-xs1bo
    @AKASHDEEP-xs1bo 7 лет назад +1

    Nice

  • @mayanksinha509
    @mayanksinha509 3 года назад

    thank you sir🙏

  • @ghulamali1824
    @ghulamali1824 5 лет назад

    sir jee very nice

  • @hackhacker5650
    @hackhacker5650 7 лет назад

    Great

  • @vikasagarwal803
    @vikasagarwal803 5 лет назад

    Please make this program using logical operator and,or, not

  • @vikasagarwal803
    @vikasagarwal803 5 лет назад

    If year%100&& year%400==0.
    Printf it is a leap year
    Else
    If year%4==0 and year%100! 0
    Printf it is a leap year.
    Else
    Printf it is not a leap year.
    Hope it will work after using proper syntax.

  • @bhaskarchauhan6567
    @bhaskarchauhan6567 7 лет назад

    sir pointers ki videos kha milengi in c

  • @Jaswantsingh-oe9ub
    @Jaswantsingh-oe9ub 4 года назад

    Isme kya galat ha
    main()
    {int a;
    printf("enter an year");
    scanf("%d",&a);
    if(a%4==0)
    {
    if (a%400==0)printf("it is a laep year");
    else printf("not a leap year");
    }
    else {
    printf("not a leap year");
    }

  • @fattocool
    @fattocool 7 лет назад

    sir getchar_unlocked() function pe ek video bnao jisme wo int me convert karta hai..plz

  • @rahulmathur3055
    @rahulmathur3055 7 лет назад +1

    Sir Prime Number Ka Video Banaiye Phir Se Samajh Nahi Aa Raha Hai Wo

  • @gadgetsamaj9605
    @gadgetsamaj9605 4 года назад

    Why we divide value from 4

  • @NurAlam-wv1qk
    @NurAlam-wv1qk 5 лет назад

    Thanks

  • @rahulrajpurohit5078
    @rahulrajpurohit5078 3 года назад

    Thanks 2nd one is better

  • @phoneo4698
    @phoneo4698 5 лет назад

    Tq so much sir

  • @mr.deepanshu5153
    @mr.deepanshu5153 4 года назад

    Sir code is not running...

  • @abhi34776
    @abhi34776 Год назад

    wow

  • @starterunivers1387
    @starterunivers1387 6 лет назад

    Sir..direct year%4 hone se toh leap year
    Else not leap year
    But apne 100 and 400 se divide kyo kiya

    • @mysirgdotcom
      @mysirgdotcom  6 лет назад

      because sabhi century year leap year nahi hote

    • @starterunivers1387
      @starterunivers1387 6 лет назад

      @@mysirgdotcom 100 and 400 kyo sir

    • @dhrubajyotiroy3301
      @dhrubajyotiroy3301 5 лет назад

      @@starterunivers1387 Bro, century years like 1700 and 1900 are divisible by 4 but they are not leap years because they are not divisible by 400.
      you have to keep two conditions in mind:
      1)If it's a century year ,then it should be divisible by 400 . Then only it"s a leap year
      2) If it's not a century year then it should be divisible by 4. Then it's a leap year.
      hope this helps

  • @akashvadher6724
    @akashvadher6724 4 года назад

    Why we not use (/) this sign
    Why use %

    • @equestbysurekha7256
      @equestbysurekha7256 4 года назад

      / gives quotient
      % gives remainder , if the remainder is 0 then completely divisible

  • @AbhishekKumar-nt5vc
    @AbhishekKumar-nt5vc 6 лет назад

    Why we divide 4 and 400 only why not 2 and 200 number.plz ans

  • @RAJ-kw9op
    @RAJ-kw9op 7 лет назад +3

    complex program, easy ho sakta tha

    • @mysirgdotcom
      @mysirgdotcom  7 лет назад +1

      how

    • @mohdsaadkhan5082
      @mohdsaadkhan5082 6 лет назад +5

      if(year%100!=0 && year%4 == 0 || year%400 == 0)
      printf("leap year");
      else
      printf("not a leap year")

    • @Travel_brat
      @Travel_brat 6 лет назад +1

      Yr bc samjh nhi arha ki 100 ka syappa kyun dala hai simply jo 4 se divide ho rha hai vo leap yr hai .....chahe vo century yr hi kyun na ho

    • @dhrubajyotiroy3301
      @dhrubajyotiroy3301 5 лет назад

      @@mohdsaadkhan5082 well done bro it's more efficient way and less coding.good job

    • @dhrubajyotiroy3301
      @dhrubajyotiroy3301 5 лет назад +2

      @@Travel_brat 1700 (century year) is divisible by 4 but it's not a leap year because it's not divisible by 400. century years must be divisible by 400

  • @bareetsingh
    @bareetsingh 5 лет назад

    Thanx sir

  • @hiteshmeharchandani3341
    @hiteshmeharchandani3341 3 года назад

    This symbol % doesnt represent division

  • @bibinbabu5742
    @bibinbabu5742 6 лет назад

    2 nd wala code easy hai

  • @aartikadiyan1592
    @aartikadiyan1592 7 лет назад +1

    First

  • @shahdivya8775
    @shahdivya8775 7 лет назад

    Ok

  • @suryayadav2587
    @suryayadav2587 4 года назад

    what about 100

  • @mohdsaadkhan5082
    @mohdsaadkhan5082 6 лет назад

    if(year%100!=0 && year%4 == 0 || year%400 == 0)
    printf("leap year");
    else
    printf("not a leap year");

    • @rajprajapati7697
      @rajprajapati7697 5 лет назад

      Why we devided only by 400 & 4....???
      Why don't other no.....
      Give me reason

  • @mr.deepanshu5153
    @mr.deepanshu5153 4 года назад

    Can you help me :)

  • @noob_coder8926
    @noob_coder8926 3 года назад

    Kya hi confuse kiya hai apne

  • @Travel_brat
    @Travel_brat 6 лет назад

    Kya chhutiyaapa sa progrme bnaya hai sir.....itna complex kyun kiya hai...simply jo 4 se divisible hai vo leap yr hai

    • @dhrubajyotiroy3301
      @dhrubajyotiroy3301 5 лет назад +1

      bro century years like 1700 and 1900 are divisible by 4 but they are not leap years . Only those century years are leap years which are divisible by 400. Hope this helps

  • @koustavchowdhury9816
    @koustavchowdhury9816 7 лет назад

    sir bitwise operator

    • @mysirgdotcom
      @mysirgdotcom  7 лет назад

      visit www.mysirg.com for bitwsie operators

  • @tusharm.8161
    @tusharm.8161 7 лет назад

    Third

  • @sunilsriramka6450
    @sunilsriramka6450 5 лет назад

    not a good logic

  • @alm7677
    @alm7677 5 лет назад

    Bakvas

  • @ojaskumar2355
    @ojaskumar2355 3 года назад

    Wrost explanation ever

  • @satusamanta5798
    @satusamanta5798 7 лет назад +1

    thank you sir