program using conditional operators to determine whether a year entered through the keyboard is a leap year or not in c




#include
main()
{

int year;

printf("Enter a year:");
scanf("%d", &year);

(year%4==0)?(printf("Leap Year")):(printf("Not a Leap Year"));

}

No comments:

Post a Comment