Check leap Year using Ternary operator #include<stdio.h> int main() { int y; printf("Enter any Year To Check Leap Year Or not :"); scanf("%d",&y); if((y%400==0)?:(y%100!=0)?(y%4==0)?1:0:0) printf("Leap Year"); else printf("Not A Leap Year"); } c Brahma Jaiswal Share to: Twitter Facebook URL Print Email Labels: c_program leap_year
Post a Comment