code is showing error. what is error..help me to fix it.. | SoloLearn: Learn to code for FREE!

+2

code is showing error. what is error..help me to fix it..

https://code.sololearn.com/cRK9J585hH37/?ref=app

c

10/16/2020 9:17:11 AM

__n

16 Answers

New Answer

+6

__n I have already attached the fix code. Please check! :) Mmm. 👇 https://code.sololearn.com/cpQUTl9WC35v/?ref=app

+4

__n You are taking three input but your code consider only two. just because of loop it's just printing 2 times. with the same value. for example you entered : 2 1901 2000 but when it reaches the code: it's becomes like 2 1901 And due to for loop : it's printing no no because the value is 1901. How to fix ? so you have to take input inside for loop. please check this code. it will help you. https://code.sololearn.com/cpQUTl9WC35v/?ref=app

+4

__n Your scanf is not present in loop so. It's ignoring your 2012. You are providing value of N only one time. But it's should be two times. if T is 2. Or you can override value of N Within loop.

+3

You can't chain the condition like 1 <= T <= 10. It will be read as (1 <= T) <= 10. Saying T is 0. 1 <= T returns 0(false) 0<=10 returns 1(true). You have to separate it with &&. if(1<=T && T <=10)

+3

__n Pleasure of mine. :)

+2

CarrieForle yes but if we takeT that is test cases as 2 then ??? take input 2 1900 2012

+2

P∆WAN M∆URY∆ then how i do it??

+2

P∆WAN M∆URY∆ thank u so much☺👍

+1

yes,but there is also one problem that for year which is not a leap its showing it is leap year(Yes)..

+1

A leap year is divisible by 4, not 2.

+1

still its showing same

+1

How do you input? I input 1 2020 and it prints yes. If I input 1 2019 it prints no.

+1

P∆WAN M∆URY∆ i think there was problem in ur code...in conditions of if .. i uploaded this.. now this is correct.. https://code.sololearn.com/cluz4AO80mKG/?ref=app

+1

__n ... What was the problem ?

+1

if(1<=T && 10>=T && 1<=N && 2500>=N) if(N%4==0 && (N%100!=0 || N%400==0)) this conditions ...

+1

Hi, This may work.... https://code.sololearn.com/c0Aw5h3Hep3X/?ref=app