Solved tcs QUEstions -1 || TCS || python programing questions || Solved.
program- #Checking if a given year is leap year or not '''Explanation: To check whether a year is leap or not Step 1: We first divide the year by 4. If it is not divisible by 4 then it is not a leap year. If it is divisible by 4 leaving remainder 0 Step 2: We divide the year by 100 If it is not divisible by 100 then it is a leap year. If it is divisible by 100 leaving remainder 0 Step 3: We divide the year by 400 If it is not divisible by 400 then it is a leap year. If it is divisible by 400 leaving remainder 0 Then it is a leap year ''''' num= int(input("Enter the num:")) if(num%4==0): if(num%100==0): if(num%400==0): print("The year{} is leap year".format(num)) else: print("The year {} is not leap year.".format(num)) else: print("The year {} is leap year".format(num)) else: print("The year {} is not leap year.".format(num)) #so lets test it tcs technical interview questions for ece tcs technical interview questions for mechanical tcs technical interview questions for eee tcs interview questions on c tcs interview questions for bcom freshers tcs interview questions pdf tcs interview questions prepinsta tcs interview questions quora
Download
0 formatsNo download links available.